diff --git a/src/components/timeline/TimelineEventEditorDialog.tsx b/src/components/timeline/TimelineEventEditorDialog.tsx index d63cef60..9135b20f 100644 --- a/src/components/timeline/TimelineEventEditorDialog.tsx +++ b/src/components/timeline/TimelineEventEditorDialog.tsx @@ -48,6 +48,7 @@ const timelineEventSchema = z.object({ 'owner_change', 'location_change', 'status_change', + 'opening', 'closure', 'reopening', 'renovation', @@ -205,20 +206,21 @@ export function TimelineEventEditorDialog({ - - Name Change - Operator Change - Ownership Change - Relocation - Status Change - Closure - Reopening - Renovation - Expansion - Acquisition - Milestone - Other - + + Name Change + Operator Change + Ownership Change + Relocation + Status Change + Opening + Closure + Reopening + Renovation + Expansion + Acquisition + Milestone + Other + diff --git a/src/types/timeline.ts b/src/types/timeline.ts index fbe23c1c..86e405a0 100644 --- a/src/types/timeline.ts +++ b/src/types/timeline.ts @@ -11,6 +11,7 @@ export type TimelineEventType = | 'owner_change' | 'location_change' | 'status_change' + | 'opening' | 'closure' | 'reopening' | 'renovation' diff --git a/supabase/migrations/20251015193124_78cdb5b0-4100-4d78-b338-14e508a6df3b.sql b/supabase/migrations/20251015193124_78cdb5b0-4100-4d78-b338-14e508a6df3b.sql new file mode 100644 index 00000000..ffc2dc37 --- /dev/null +++ b/supabase/migrations/20251015193124_78cdb5b0-4100-4d78-b338-14e508a6df3b.sql @@ -0,0 +1,21 @@ +-- Add 'opening' to timeline event types +ALTER TABLE public.entity_timeline_events +DROP CONSTRAINT 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' +)); \ No newline at end of file