Repository navigation
fix(db): keep migrations, reset, seed and auth schema upgrades from damaging databases - #435
Conversation
…amaging databases - vp dev applies no pending migration when one is destructive without the pragma - db migrate --remote stops for a D1 binding without migrations_dir - db rename-migrations stops for direct Cloudflare and unlinked Void projects; MySQL tracking renames run in one transaction - db reset drops PostgreSQL views, sequences and custom types in public and MySQL views; it stops before dropping when another schema uses them - db seed checks the file and asks about a non-local database before it loads the seed module and resets - void db actions reject flags they do not read - db status reports an unreadable local database; export keeps MySQL dates, JSON and BIGINT as text and keeps app tables that start with _ - auth migrations add fixed defaults and refuse required fields on populated SQLite/PostgreSQL tables; PostgreSQL serial and uuid ids get a default - PostgreSQL and MySQL migrate handlers report committed files when the auth step fails - messages follow sourceDir; init demo follows the chosen database Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98b9f71914
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s it Run the other-schema check only when reset drops types or sequences, and describe what the table drops still remove in other schemas. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99880f3439
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…alls Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d1ed44bd8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bc534927b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d614910d66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ry SQL mode Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f713ce103
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n every string mode Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce58ddbb13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe59b37c6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…veral rows Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f85f0f26c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Problem
Some
void dbcommands, the dev migration step, and the auth schema upgrade could change the wrong database, apply SQL that was never checked, or leave a database that no command can repair.What this PR changes
Decisions
rename-migrationson direct Cloudflare.default(false)onuser.emailVerifiedmakes drizzle-kit rebuilduseron SQLite; on D1 theDROP TABLE usercascades and deletes every session and account.void dbflagspublicview, sequence or type it drops (DROP TYPE … CASCADEwould delete their columns). Table drops keep the existingCASCADEbehavior.Behavior changes to note in the release
vp devno longer applies a pending destructive migration without-- void:allow-destructive. It applies no pending file for that start.void db migrate --remoteneedsmigrations_diron the D1 binding. Void writes it on every provision.void db rename-migrationsstops for direct Cloudflare projects and for Void projects that are not linked.void db <action>rejects flags that the action does not use, for examplevoid db reset --remote.void db statusexits 1 when it can read neither the local nor the remote PostgreSQL/MySQL database.void db seedasks about a non-local database before it loads the seed module.uniqueauth field to a table with two or more rows fails before any change, on every dialect.generateId: 'serial'or'uuid': deploy reports schema drift untilvoid db generatewrites the migration that adds the id default.Known limits
void db generate; a required field with a default still has no backfill there..void/project.json, sorename-migrationscannot see the deployment. Aftervoid connectit stops as expected.publictables withCASCADE, as before: a view, a foreign key, an inheriting table or a partition in another schema that depends on apublictable goes with it.public. A migration withCREATE FUNCTIONorCREATE SCHEMAstill fails on reset.NO_BACKSLASH_ESCAPESchanges backslashes in strings (same as main). MySQL export still skips views (same as main).Testing
search_path, objects in other schemasvoid db execute --filevp run build:all,vp run check,vp lint,vp fmt --checkvp run test🤖 Generated with Claude Code
https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH