Make all migration SQL files idempotent for clean prod deploys
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m14s

Added IF NOT EXISTS, IF EXISTS, and DO $$ EXCEPTION guards to all
migration files from 20260205 onwards so they survive partial application
and work correctly on both fresh databases and existing deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt
2026-02-16 13:09:41 +01:00
parent 763b2ef0f5
commit effc078918
9 changed files with 768 additions and 446 deletions

View File

@@ -1,2 +1,2 @@
-- CreateIndex
CREATE INDEX "AwardVote_awardId_userId_idx" ON "AwardVote"("awardId", "userId");
CREATE INDEX IF NOT EXISTS "AwardVote_awardId_userId_idx" ON "AwardVote"("awardId", "userId");