11 lines
653 B
SQL
11 lines
653 B
SQL
-- Migration: Add 'registered' and 'unregistered' status to videos check constraint
|
|
-- Date: 2026-05-15
|
|
-- Usage: psql -U accusys -d momentry -f migrate_add_registered_status.sql
|
|
|
|
ALTER TABLE videos DROP CONSTRAINT IF EXISTS chk_videos_status;
|
|
ALTER TABLE videos ADD CONSTRAINT chk_videos_status
|
|
CHECK (status::text = ANY (ARRAY['unregistered'::text, 'registered'::text, 'pending'::text, 'processing'::text, 'completed'::text, 'failed'::text]));
|
|
|
|
-- Set all incomplete files to 'unregistered' (old 'pending' files that never finished pipeline)
|
|
UPDATE videos SET status = 'unregistered' WHERE status NOT IN ('completed', 'registered', 'unregistered');
|