Skip to main content

max / goingson

788 B · 17 lines History Blame Raw
1 -- Follow-up tracking for tasks and emails
2 -- Adds ability to mark items as "waiting for response"
3
4 -- Add waiting_for fields to tasks
5 ALTER TABLE tasks ADD COLUMN waiting_for_response INTEGER NOT NULL DEFAULT 0;
6 ALTER TABLE tasks ADD COLUMN waiting_since TEXT;
7 ALTER TABLE tasks ADD COLUMN expected_response_date TEXT;
8
9 -- Add waiting_for fields to emails
10 ALTER TABLE emails ADD COLUMN waiting_for_response INTEGER NOT NULL DEFAULT 0;
11 ALTER TABLE emails ADD COLUMN waiting_since TEXT;
12 ALTER TABLE emails ADD COLUMN expected_response_date TEXT;
13
14 -- Create indexes for efficient waiting-for queries
15 CREATE INDEX idx_tasks_waiting ON tasks(waiting_for_response) WHERE waiting_for_response = 1;
16 CREATE INDEX idx_emails_waiting ON emails(waiting_for_response) WHERE waiting_for_response = 1;
17