fix(migrations): unbreak main — 20260826180000 was claimed twice - #778
Merged
Conversation
main is red and nothing is deploying. Two migrations merged with the same version: 20260826180000_mention_queue_all_mentions.sql (this session) 20260826180000_resolve_username_history_rpc.sql (a parallel session) Supabase keys schema_migrations on the version alone, so the second INSERT fails and every deploy aborts. cd.yml skips its deploy job unless the triggering CI run succeeded, which is why the symptom was a CD run reporting "skipped" rather than a failure — main red, nothing shipped, and no red deploy to notice. Neither migration had been applied to production (schema_migrations has no 2026082618% rows), so renaming is safe and loses nothing. This is the SECOND collision with the same session today; the first was caught pre-merge by the Migration Replay gate and by that session's own migrations-unique-version test. Both PRs were green independently — the collision only exists in the MERGE, which neither branch tested. Two green PRs can still make a red main, and picking a timestamp needs `git ls-tree origin/main supabase/migrations/` first, not a glance at the local tree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
main is red and nothing is deploying. Two migrations merged with the same version:
Supabase keys
schema_migrationson the version alone, so the second INSERT fails and every deploy aborts.Why the symptom was confusing
cd.ymlskips its deploy job unless the triggering CI run succeeded:So the visible signal was a CD run reporting
skipped— main red, nothing shipped, and no red deploy to notice. Exactly the "CI is green, no check is red, and nothing deploys" shape this repo's CLAUDE.md warns about, arriving from the other direction.Safe to rename
Neither migration had been applied to production —
schema_migrationshas no2026082618%rows — so renaming loses nothing.The lesson, since this is the second time today
The first collision was caught pre-merge by the Migration Replay gate and by the parallel session's own
migrations-unique-versiontest. This one wasn't, because both PRs were green independently — the collision only exists in the merge, which neither branch tested.Two green PRs can still make a red main. Picking a migration timestamp needs
git ls-tree origin/main supabase/migrations/, not a glance at the local tree.Verification
migrations-unique-versionpasses🤖 Generated with Claude Code