Skip to content

fix(cli): exclude Void migration tables and fail on aborted db push - #1033

Open
SHANNWD wants to merge 1 commit into
voidzero-dev:mainfrom
SHANNWD:fix/db-push-migration-tables-976
Open

SHANNWD wants to merge 1 commit into
voidzero-dev:mainfrom
SHANNWD:fix/db-push-migration-tables-976

Conversation

@SHANNWD

@SHANNWD SHANNWD commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Excludes Void's internal migration and D1 metadata tables (_void_migrations, _void_migration_lock, _migrations, _cf_KV, d1_migrations) via tablesFilter when running void db push, preventing Drizzle Kit from asking to delete the migration journal after void db migrate.

Also wraps void db push consistently so declined prompts (All changes were aborted) and non-TTY prompt failures (Interactive prompts require a TTY terminal) exit with code 1 instead of 0.

Verification

  • vp fmt packages/void/src/cli/db.ts
  • vp lint on modified files (0 warnings, 0 errors)
  • vp run --filter ./packages/void typecheck
  • vp test run packages/void/test/unit/db-studio-remote.test.ts packages/void/test/unit/drizzle-config.test.ts packages/void/test/unit/db-args.test.ts

Fixes #976

@cpojer

cpojer commented Dec 4, 2026

Copy link
Copy Markdown
Member

Slop review:

P2 — A PostgreSQL push can silently skip schema changes. With an application-owned d1_migrations table, the second push tried to recreate it, skipped an unrelated column addition, and exited 0. Drizzle Kit filters the live database but still reads the table from the app schema. Scope the filter by dialect and handle explicitly declared tables on both sides of the comparison. Filter passed to PostgreSQL
P2 — Two D1 recovery tables remain unprotected. A local push preserved _void_migrations but deleted _void_migration_attempts and _void_migration_fences without prompting when they were empty. Include both in the D1 filter. Table list
P3 — A successful push can report failure. When a schema logged All changes were aborted as part of a longer message, the column was added successfully but the CLI exited 1. Match Drizzle Kit’s complete abort diagnostic. Output check

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

void db push on D1 asks to delete Void's migration journal after void db migrate

2 participants