new Approval Updates
Deploy / deploy (push) Failing after 3m34s

This commit is contained in:
twotalesanimation
2026-06-11 12:30:28 +02:00
parent b9610454d9
commit 3f0c5d1dbe
19 changed files with 2015 additions and 70 deletions
@@ -0,0 +1,54 @@
-- Two-stage review gate migration
-- Replaces IN_REVIEW with INTERNAL_REVIEW, adds READY_FOR_CLIENT and CLIENT_REVIEW,
-- adds ShotApprovalStatus enum, and adds shotApprovalStatus + sharedWithClient to shots.
-- ── 1. Recreate ShotStatus enum with new values ───────────────────────────────
-- Create replacement enum
CREATE TYPE "ShotStatus_new" AS ENUM (
'WAITING',
'IN_PROGRESS',
'INTERNAL_REVIEW',
'READY_FOR_CLIENT',
'CLIENT_REVIEW',
'REVISIONS',
'COMPLETE'
);
-- Migrate shots table: IN_REVIEW → INTERNAL_REVIEW
ALTER TABLE "shots"
ALTER COLUMN "status" TYPE "ShotStatus_new"
USING (
CASE "status"::text
WHEN 'IN_REVIEW' THEN 'INTERNAL_REVIEW'::"ShotStatus_new"
ELSE "status"::text::"ShotStatus_new"
END
);
-- Migrate assets table: IN_REVIEW → INTERNAL_REVIEW
ALTER TABLE "assets"
ALTER COLUMN "status" TYPE "ShotStatus_new"
USING (
CASE "status"::text
WHEN 'IN_REVIEW' THEN 'INTERNAL_REVIEW'::"ShotStatus_new"
ELSE "status"::text::"ShotStatus_new"
END
);
-- Drop old enum and rename new one
DROP TYPE "ShotStatus";
ALTER TYPE "ShotStatus_new" RENAME TO "ShotStatus";
-- ── 2. Create ShotApprovalStatus enum ────────────────────────────────────────
CREATE TYPE "ShotApprovalStatus" AS ENUM (
'PENDING',
'INTERNALLY_APPROVED',
'CLIENT_APPROVED'
);
-- ── 3. Add new columns to shots ───────────────────────────────────────────────
ALTER TABLE "shots"
ADD COLUMN "shotApprovalStatus" "ShotApprovalStatus" NOT NULL DEFAULT 'PENDING',
ADD COLUMN "sharedWithClient" BOOLEAN NOT NULL DEFAULT false;