Skip to content

fix(cli): protect migration journals and report incomplete db push - #935

Draft
hyfdev wants to merge 3 commits into
mainfrom
fix/db-push-migrations-table
Draft

hyfdev wants to merge 3 commits into
mainfrom
fix/db-push-migrations-table

Conversation

@hyfdev

@hyfdev hyfdev commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

On D1, once migrations have been applied, adding a table and running void db push asks to rename or delete Void's migration journal.

When a push prompt can't open or is declined, push still reports success and exits 0:

Error: Interactive prompts require a TTY terminal (process.stdin.isTTY or process.stdout.isTTY is false). …
✓ Database schema pushed.

Push now leaves Void's migration tables alone on D1, PostgreSQL and MySQL, and an incomplete push exits 1:

Database schema push did not complete. For prompts, run `void db push` in a terminal. To review changes, use `void db generate` and `void db migrate`.

Drizzle Kit exits 0 in those cases, so push and void db generate now exit 1 unless Kit prints its completion or no-changes line.

A push with nothing to change no longer prints the success line.

Better Auth tables

On a migrated D1 database, confirming the journal prompt also dropped empty auth tables.

With that prompt gone, push would drop them without asking, so push now gives Kit the generated Better Auth schema, as void db generate does.

It stops before Kit runs if auth.ts fails to load.

Push can still change two kinds of existing auth tables:

  • Created by vite dev: push replaces their unique keys without asking on D1. On PostgreSQL and MySQL, it asks whether to truncate user and session to add them.
  • Created by older MySQL migrations: if they have rows, push asks whether to truncate them, and running void db generate and void db migrate first avoids this by converting their TIMESTAMP(3) dates (fix(auth): support datetime for MySQL auth dates #968).

Fixes #976.

Fixes #977.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-db-push-migrations-table-void-cloud.voidzero-docs.workers.dev (commit a760db2)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://78025038-void-cloud.voidzero-docs.workers.dev a760db2 2026-11-29T02:09:56.531Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://2c67f013-void-cloud.voidzero-docs.workers.dev 12bf065 2026-11-27T00:30:59.616Z Visit the dashboard ↗

@hyfdev
hyfdev marked this pull request as ready for review November 27, 2026 00:40
Copilot AI balanced review requested due to automatic review settings November 27, 2026 00:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@hyfdev
hyfdev marked this pull request as draft November 28, 2026 18:32

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 deletes empty auth tables without listing them void db push on D1 asks to delete Void's migration journal after void db migrate

2 participants