Skip to main content

max / goingson

660 B · 13 lines History Blame Raw
1 -- Task-Event Integration: Link events to tasks and add event recurrence
2
3 -- Link events to tasks (for auto-created events from tasks with due dates)
4 ALTER TABLE events ADD COLUMN linked_task_id TEXT REFERENCES tasks(id) ON DELETE SET NULL;
5 CREATE INDEX idx_events_linked_task ON events(linked_task_id);
6
7 -- Add recurrence to events (same pattern as tasks)
8 ALTER TABLE events ADD COLUMN recurrence TEXT NOT NULL DEFAULT 'None';
9 ALTER TABLE events ADD COLUMN recurrence_parent_id TEXT REFERENCES events(id) ON DELETE SET NULL;
10 CREATE INDEX idx_events_recurrence_parent ON events(recurrence_parent_id);
11
12 -- Note: user_id already added in migration 002_users.sql
13