summaryrefslogtreecommitdiff
path: root/migrations/026_task_chains.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/026_task_chains.sql')
-rw-r--r--migrations/026_task_chains.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/migrations/026_task_chains.sql b/migrations/026_task_chains.sql
new file mode 100644
index 0000000..5ed14d7
--- /dev/null
+++ b/migrations/026_task_chains.sql
@@ -0,0 +1,16 @@
+-- Linear task chains: a fixed, ordered sequence of native tasks with a WIP
+-- limit of exactly 1 -- only the task at the current position is ever
+-- unlocked/actionable. Completing it unlocks the next position; completing
+-- the last position marks the chain completed instead.
+CREATE TABLE task_chains (
+ id TEXT PRIMARY KEY,
+ project_id TEXT NOT NULL,
+ status TEXT NOT NULL DEFAULT 'active',
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+ALTER TABLE native_tasks ADD COLUMN chain_id TEXT DEFAULT '';
+ALTER TABLE native_tasks ADD COLUMN chain_position INTEGER DEFAULT 0;
+ALTER TABLE native_tasks ADD COLUMN chain_unlocked BOOLEAN DEFAULT 0;
+
+CREATE INDEX IF NOT EXISTS idx_native_tasks_chain ON native_tasks(chain_id);