diff --git a/prisma/migrations/20260611000000_two_stage_review_gate/migration.sql b/prisma/migrations/20260611000000_two_stage_review_gate/migration.sql index 6472ae4..bbc09fe 100644 --- a/prisma/migrations/20260611000000_two_stage_review_gate/migration.sql +++ b/prisma/migrations/20260611000000_two_stage_review_gate/migration.sql @@ -15,7 +15,8 @@ CREATE TYPE "ShotStatus_new" AS ENUM ( 'COMPLETE' ); --- Migrate shots table: IN_REVIEW → INTERNAL_REVIEW +-- Migrate shots table: drop default, change type, restore default +ALTER TABLE "shots" ALTER COLUMN "status" DROP DEFAULT; ALTER TABLE "shots" ALTER COLUMN "status" TYPE "ShotStatus_new" USING ( @@ -24,8 +25,10 @@ ALTER TABLE "shots" ELSE "status"::text::"ShotStatus_new" END ); +ALTER TABLE "shots" ALTER COLUMN "status" SET DEFAULT 'WAITING'::"ShotStatus_new"; --- Migrate assets table: IN_REVIEW → INTERNAL_REVIEW +-- Migrate assets table: drop default, change type, restore default +ALTER TABLE "assets" ALTER COLUMN "status" DROP DEFAULT; ALTER TABLE "assets" ALTER COLUMN "status" TYPE "ShotStatus_new" USING ( @@ -34,6 +37,7 @@ ALTER TABLE "assets" ELSE "status"::text::"ShotStatus_new" END ); +ALTER TABLE "assets" ALTER COLUMN "status" SET DEFAULT 'WAITING'::"ShotStatus_new"; -- Drop old enum and rename new one DROP TYPE "ShotStatus";