Skip to content

fix: make 0218 event_routes migration idempotent#957

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/migration-0218-idempotent-v2
Jun 16, 2026
Merged

fix: make 0218 event_routes migration idempotent#957
dylanjeffers merged 1 commit into
mainfrom
fix/migration-0218-idempotent-v2

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

The ALTER TABLE ADD CONSTRAINT was not guarded, causing bridge migrate to fail when the table already exists. Inlines PRIMARY KEY into CREATE TABLE IF NOT EXISTS so re-runs are safe. This was blocking all auto-upgrades since June 10.

CREATE TABLE IF NOT EXISTS silently skips if the table already exists,
but the subsequent ALTER TABLE ADD CONSTRAINT had no guard — causing:

  ERROR: multiple primary keys for table "event_routes" are not allowed

on any DB where the table was already created.  Fix by inlining the
PRIMARY KEY constraint in the CREATE TABLE definition so the whole
statement is skipped under IF NOT EXISTS.

This has been blocking bridge auto-upgrades since the 0218 migration
was first applied to production (June 9).  All migrate-* jobs in the
api namespace have been failing, leaving 60+ auto-upgrader CronJob
pods stuck in a 30-min kubectl-wait loop.
@dylanjeffers dylanjeffers merged commit 076ec0a into main Jun 16, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the fix/migration-0218-idempotent-v2 branch June 16, 2026 02:22
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