diff --git a/prisma/migrations/0197_coach_plan_outcome/migration.sql b/prisma/migrations/0197_coach_plan_outcome/migration.sql index fa0d848ab..1a8ea6d9d 100644 --- a/prisma/migrations/0197_coach_plan_outcome/migration.sql +++ b/prisma/migrations/0197_coach_plan_outcome/migration.sql @@ -3,4 +3,4 @@ -- processed, the grounded before/after result is written here. Additive, -- nullable Bytes column — no backfill, no enum change (the new statuses -- review_due / reviewed are app-side strings on the existing `status` column). -ALTER TABLE "coach_plans" ADD COLUMN "outcome_encrypted" BYTEA; +ALTER TABLE "coach_plans" ADD COLUMN IF NOT EXISTS "outcome_encrypted" BYTEA; diff --git a/prisma/migrations/0198_v122_ai_settings/migration.sql b/prisma/migrations/0198_v122_ai_settings/migration.sql index d74386379..65c345959 100644 --- a/prisma/migrations/0198_v122_ai_settings/migration.sql +++ b/prisma/migrations/0198_v122_ai_settings/migration.sql @@ -17,10 +17,10 @@ -- encrypted-columns registry + the rotation script). -- -- All columns are nullable / defaulted, so existing rows need no backfill. -ALTER TABLE "User" - ADD COLUMN "ai_response_timeout_seconds" INTEGER, - ADD COLUMN "ai_ocr_enabled" BOOLEAN NOT NULL DEFAULT false, - ADD COLUMN "ai_ocr_provider" TEXT, - ADD COLUMN "ai_ocr_model" TEXT, - ADD COLUMN "ai_ocr_base_url" TEXT, - ADD COLUMN "ai_ocr_key_encrypted" TEXT; +ALTER TABLE "users" + ADD COLUMN IF NOT EXISTS "ai_response_timeout_seconds" INTEGER, + ADD COLUMN IF NOT EXISTS "ai_ocr_enabled" BOOLEAN NOT NULL DEFAULT false, + ADD COLUMN IF NOT EXISTS "ai_ocr_provider" TEXT, + ADD COLUMN IF NOT EXISTS "ai_ocr_model" TEXT, + ADD COLUMN IF NOT EXISTS "ai_ocr_base_url" TEXT, + ADD COLUMN IF NOT EXISTS "ai_ocr_key_encrypted" TEXT;