fix(apply-migrations): keep --list read-only — never auto-apply schema migrations when --list is combined with --yes/--non-interactive

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-07-22 12:15:28 -07:00
co-authored by Claude Fable 5
parent 2bfbb4104d
commit 04577dd7b1
+3 -1
View File
@@ -419,7 +419,9 @@ export async function runApplyMigrations(args: string[]): Promise<void> {
schemaBehind = await resolveSchemaBehind({
schemaVer,
latest: LATEST_VERSION,
autoApply: (cli.yes || cli.nonInteractive) && !cli.dryRun,
// --list and --dry-run are read-only surfaces: never mutate schema
// even when combined with --yes/--non-interactive.
autoApply: (cli.yes || cli.nonInteractive) && !cli.dryRun && !cli.list,
run: () => runMigrations(eng),
});
await eng.disconnect();