Files
thrilltrack-explorer/supabase/migrations/20251015195451_c71e7003-6b30-4e1e-84de-7f4afec701bc.sql
2025-10-15 19:55:26 +00:00

45 lines
1.1 KiB
SQL

-- Fix entity_timeline_events event_type constraint to include 'opening'
ALTER TABLE public.entity_timeline_events
DROP CONSTRAINT IF EXISTS entity_timeline_events_event_type_check;
ALTER TABLE public.entity_timeline_events
ADD CONSTRAINT entity_timeline_events_event_type_check
CHECK (event_type IN (
'name_change',
'operator_change',
'owner_change',
'location_change',
'status_change',
'opening',
'closure',
'reopening',
'renovation',
'expansion',
'acquisition',
'milestone',
'other'
));
-- Add 'milestone' to content_submissions submission_type constraint
ALTER TABLE public.content_submissions
DROP CONSTRAINT IF EXISTS content_submissions_submission_type_check;
ALTER TABLE public.content_submissions
ADD CONSTRAINT content_submissions_submission_type_check
CHECK (submission_type IN (
'park',
'ride',
'review',
'photo',
'manufacturer',
'operator',
'designer',
'property_owner',
'photo_edit',
'photo_delete',
'ride_model',
'milestone'
));
COMMENT ON CONSTRAINT content_submissions_submission_type_check ON public.content_submissions IS
'milestone submissions are for entity timeline/historical events';