Make all migration SQL files idempotent for clean prod deploys
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m14s
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:
@@ -1,3 +1,7 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "JuryGroupMember" ADD COLUMN "selfServiceCap" INTEGER,
|
||||
ADD COLUMN "selfServiceRatio" DOUBLE PRECISION;
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "JuryGroupMember" ADD COLUMN "selfServiceCap" INTEGER;
|
||||
EXCEPTION WHEN duplicate_column THEN NULL; END $$;
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "JuryGroupMember" ADD COLUMN "selfServiceRatio" DOUBLE PRECISION;
|
||||
EXCEPTION WHEN duplicate_column THEN NULL; END $$;
|
||||
|
||||
Reference in New Issue
Block a user