Skip to content

fix(migrations): unbreak main — 20260826180000 was claimed twice - #778

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/migration-collision-2
Aug 26, 2026
Merged

fix(migrations): unbreak main — 20260826180000 was claimed twice#778
github-actions[bot] merged 1 commit into
mainfrom
fix/migration-collision-2

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

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.

Why the symptom was confusing

cd.yml skips its deploy job unless the triggering CI run succeeded:

if: github.event_name == 'workflow_dispatch' ||
    github.event.workflow_run.conclusion == 'success'

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_migrations has no 2026082618% 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-version test. 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-version passes
  • production confirmed clean of both versions before renaming

🤖 Generated with Claude Code

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>
@github-actions
github-actions Bot merged commit 5be5e80 into main Aug 26, 2026
8 checks passed
@github-actions
github-actions Bot deleted the fix/migration-collision-2 branch August 26, 2026 21:42
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.

1 participant