1
0

004_task_metadata_and_links.sql 656 B

123456789101112
  1. -- Phase 22: per-task description + URL + bidirectional copy linkage.
  2. --
  3. -- description / url default to '' so existing rows stay valid without a
  4. -- backfill. linked_task_id is set on a *copy* and points at its source task;
  5. -- the reverse direction is reached by `WHERE linked_task_id = ?`. ON DELETE
  6. -- SET NULL keeps the copy alive when the source is deleted.
  7. ALTER TABLE tasks ADD COLUMN description TEXT NOT NULL DEFAULT '';
  8. ALTER TABLE tasks ADD COLUMN url TEXT NOT NULL DEFAULT '';
  9. ALTER TABLE tasks ADD COLUMN linked_task_id INTEGER REFERENCES tasks(id) ON DELETE SET NULL;
  10. CREATE INDEX idx_tasks_linked ON tasks(linked_task_id);