@@ -15,7 +15,8 @@ CREATE TYPE "ShotStatus_new" AS ENUM (
|
|||||||
'COMPLETE'
|
'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 TABLE "shots"
|
||||||
ALTER COLUMN "status" TYPE "ShotStatus_new"
|
ALTER COLUMN "status" TYPE "ShotStatus_new"
|
||||||
USING (
|
USING (
|
||||||
@@ -24,8 +25,10 @@ ALTER TABLE "shots"
|
|||||||
ELSE "status"::text::"ShotStatus_new"
|
ELSE "status"::text::"ShotStatus_new"
|
||||||
END
|
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 TABLE "assets"
|
||||||
ALTER COLUMN "status" TYPE "ShotStatus_new"
|
ALTER COLUMN "status" TYPE "ShotStatus_new"
|
||||||
USING (
|
USING (
|
||||||
@@ -34,6 +37,7 @@ ALTER TABLE "assets"
|
|||||||
ELSE "status"::text::"ShotStatus_new"
|
ELSE "status"::text::"ShotStatus_new"
|
||||||
END
|
END
|
||||||
);
|
);
|
||||||
|
ALTER TABLE "assets" ALTER COLUMN "status" SET DEFAULT 'WAITING'::"ShotStatus_new";
|
||||||
|
|
||||||
-- Drop old enum and rename new one
|
-- Drop old enum and rename new one
|
||||||
DROP TYPE "ShotStatus";
|
DROP TYPE "ShotStatus";
|
||||||
|
|||||||
Reference in New Issue
Block a user