Repository navigation
Give each database step its own number, so the app starts again - #23
Merged
Merged
Conversation
Two branches each added migration 0010 (the trash, and the settings chosen for the user) and both were merged. Every start then failed with "UNIQUE constraint failed: schema_migrations.version", and so did every test that opens a store. The migrations run in one transaction, so a failed start changed nothing in the data folder. The trash was merged first and keeps 0010. The settings step becomes 0011 and the month's spending 0012. No release holds any of them (0.3.0 ends at 0008). Store now refuses two steps that share a number before it opens the database, with a message naming both files, and a test checks the shipped folder and a data folder from before all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T34myw2b3182Wh95SF4i7u
Codex Review Summary: ✅ CompletedThis 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What went wrong
#21 added
0010_trash.sql, and #22 added0010_chosen_for_the_user.sql(and0011_claude_months.sql). Both were merged, and nothing conflicted because the file names differ. Since then, every start fails with:Every unit test that opens a
Storefails the same way, and CI onmain(7fbafc5) is red on all three operating systems. The steps run in one transaction, so a failed start leaves the data folder as it was. Each attempt also rewritesapp.db.bak-<n>with the same contents.The fix
0010_trash.sqlkeeps 10, because it reachedmainfirst.0010_chosen_for_the_user.sql→0011_chosen_for_the_user.sql0011_claude_months.sql→0012_claude_months.sqlNo release contains any of these steps (0.3.0 ends at 0008), so installed copies are unaffected. A data folder written by
mainbetween the two merges (10 = trash) picks up 11 and 12 as normal.Keeping it from happening again
migrationScriptsinsrc/db/store.tsrefuses two steps that share a number, before the database is opened. The error names both files, so a bad merge fails every test straight away with a clear message.test/store.test.ts:CLAUDE.md,docs/architecture.mdand decision 11 name the new numbers.CLAUDE.mdnow says that the branch merged second renumbers its steps first.Checks
npm test: 239 passedtsc(main and ui) andnpm run format:check: cleannpm run buildandxvfb-run -a npm run test:app: running when this was opened; results follow in a comment if anything fails.https://claude.ai/code/session_01T34myw2b3182Wh95SF4i7u
Generated by Claude Code