Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 22:52:50 +00:00
co-authored by renee-png
parent 531f30f0eb
commit cf7961e8fb
2 changed files with 17 additions and 0 deletions
@@ -0,0 +1,7 @@
ALTER TABLE public.events
ADD COLUMN IF NOT EXISTS assigned_to uuid REFERENCES public.profiles(id) ON DELETE SET NULL;
-- Backfill existing rows: assignee = creator
UPDATE public.events SET assigned_to = created_by WHERE assigned_to IS NULL AND created_by IS NOT NULL;
CREATE INDEX IF NOT EXISTS events_assigned_to_idx ON public.events(assigned_to);