Files
loki/drizzle/0064_feedback_screenshots_array.sql
T
Cato cb7191bb1a fix(db): remove DROP substring from 0064 so deploy gate passes (#544)
The gate greps the whole migration file. A comment that said do-not-drop
still matched and aborted ship.
2026-09-09 09:49:56 -07:00

10 lines
492 B
SQL

-- Migration: add site_feedback.screenshots (jsonb array).
-- Keep the legacy screenshot text column. New writers use screenshots only.
-- Copy any existing single image into the array when the array is empty.
ALTER TABLE "site_feedback" ADD COLUMN IF NOT EXISTS "screenshots" jsonb;
UPDATE "site_feedback"
SET "screenshots" = jsonb_build_array("screenshot"::text)
WHERE "screenshot" IS NOT NULL
AND ("screenshots" IS NULL OR "screenshots" = 'null'::jsonb OR "screenshots" = '[]'::jsonb);