| 1 | ALTER TABLE chat_projects ADD COLUMN title text; |
| 2 | ALTER TABLE chat_cards ADD COLUMN task_id text; |
| 3 | ALTER TABLE chat_cards ADD COLUMN name text; |
| 4 | CREATE INDEX chat_card_task ON chat_cards(task_id); |
| 5 | CREATE TABLE chat_project_attachments (project_id text, kind text, ref text, name text, created_at datetime, PRIMARY KEY (project_id, kind, ref)); |
| 6 | CREATE TABLE chat_tasks (id text PRIMARY KEY, project_id text, title text, brief text, stage text, branch text, base_sha text, creator text, turn_id text, cancel_requested numeric, revision integer, created_at datetime, updated_at datetime); |
| 7 | CREATE INDEX chat_task_project ON chat_tasks(project_id); |
| 8 | CREATE TABLE chat_steps (id text PRIMARY KEY, task_id text, idx integer, specialist text, person text, state text, reason text, attempt integer, base_sha text, candidate_sha text, pushed numeric, terminated numeric, summary text, log_tail text, started_at datetime, finished_at datetime, revision integer, created_at datetime, updated_at datetime); |
| 9 | CREATE INDEX chat_step_task ON chat_steps(task_id); |
| 10 | CREATE TABLE chat_task_entries (id text PRIMARY KEY, task_id text, idempotency_key text, kind text, author text, text text, repo text, path text, line integer, created_at datetime); |
| 11 | CREATE INDEX chat_entry_task ON chat_task_entries(task_id); |
| 12 | CREATE UNIQUE INDEX chat_entry_key ON chat_task_entries(task_id, idempotency_key); |
| 13 | |