Fix duplicate migration 000036: renumber stashes to 000037 - #977
Conversation
#969 and #974 both added core migration 000036 and merged together, so main has two migrations with one number: TestMigrations_GaplessSequence fails and golang-migrate refuses a duplicate version. The stashes tables move to 000037; neither migration has been applied anywhere yet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W8zrackYDNg1g6gV6czVhv
|
Build & Test is red on purpose-built grounds: the migration immutability guard. The guard protects databases that may already have applied the migration. That can't be the case here. Main currently has two migrations numbered 36 ( Options:
Steps after the guard did not run in CI. Locally, Generated by Claude Code |
Main carries two core migrations numbered 000036, which fails the gapless check and the fresh-database replay. Same change as #977 (stashes renumbered to 000037); it becomes a no-op once #977 merges. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LRXHkzaU3FMF7PAvtf2Lse
Requested by Key Maker · project thread
Fixes: none
Security implication: none (migration file renumber only)
Consumer-verified: n/a
Mockup: n/a
What this changes
Before: #969 (
000036_campaign_book_edits) and #974 (000036_stashes) both merged with core migration number 36. Main failsTestMigrations_GaplessSequence(full sequence: [... 35 36 36]), and golang-migrate refuses two migrations with one version, so a server built from main would not migrate.After: the stashes migration is
000037_stashesandExpectedCoreMigrationVersionis 37. File contents are unchanged.Why
The two PRs were open at the same time and each took the next free number. Renumbering is safe because neither migration has been applied anywhere (nothing deployed since they merged). Merge this before deploying.
Test plan
go test -short ./internal/database/failsTestMigrations_GaplessSequencego test -short ./internal/database/okCHRONICLE_TEST_DB_DSN='root@tcp(127.0.0.1:13306)/' go test ./internal/database/ ./cmd/...: ok (fresh-DB replay incmd/serverincluded)go build ./...Tenet self-check
🤖 Generated with Claude Code
https://claude.ai/code/session_01W8zrackYDNg1g6gV6czVhv
Generated by Claude Code