deckhearth/migrations
Randall Stillwell a000c59ec4 fix(migrate): pre-check pg_constraint instead of catching duplicate_object
ADD CONSTRAINT UNIQUE creates a supporting index under the hood; when
the index name already exists from initial-schema's inline UNIQUE,
Postgres raises SQLSTATE 42P07 (duplicate_table), not 42710
(duplicate_object) — so the EXCEPTION block didn't catch it and CI's
Migrations apply gate failed with `relation
"user_cards_user_id_card_id_is_foil_key" already exists`.

Swap to a pg_constraint pre-check: bulletproof against both SQLSTATEs
without overreaching to WHEN OTHERS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 08:08:47 -05:00
..
1779853647564_initial-schema.js feat(infra): adopt node-pg-migrate + backfill initial schema migration (#32) 2026-05-26 23:01:58 -05:00
1779853647565_add-pg-trgm-card-name-index.js feat(scanner): AI Gateway vision + Layer-1 Tesseract/pg_trgm OCR (#38) 2026-05-27 12:59:59 -05:00
1779853647566_add-scan-tables.js ci: run migrations against Postgres service container in CI (#64) 2026-06-02 11:01:18 -05:00
1779908094455_add-user-cards-scan-image-url.js feat(scanner): persist scan captures to Blob (Brief 3) (#44) 2026-05-27 13:57:26 -05:00
1780378340194_system-collection-description.js ci: run migrations against Postgres service container in CI (#64) 2026-06-02 11:01:18 -05:00
1781000000006_reconcile-user-cards-unique.js fix(migrate): pre-check pg_constraint instead of catching duplicate_object 2026-06-14 08:08:47 -05:00
1781440700404_add-scryfall-bulk-columns.js feat(catalog): Scryfall bulk data import + Tagger community tags 2026-06-14 07:51:39 -05:00
1781440721350_add-tagger-tables.js feat(catalog): Scryfall bulk data import + Tagger community tags 2026-06-14 07:51:39 -05:00