From c9c192d2b33f41d8351a418d9f9eef6f7010a38d Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:13:35 +0200 Subject: [PATCH] more db issues --- .../20260611000000_two_stage_review_gate/migration.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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";