summaryrefslogblamecommitdiff
path: root/makima/migrations/20250121000000_add_branched_from.sql
blob: bbb395bf3150aacb89ab8df26cf912b995e4ab73 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                                                                             
-- Add branched_from_task_id column to tasks table for task branching support.
-- This allows creating new tasks that branch from an existing task's conversation,
-- enabling "what if" exploration of different approaches from the same starting point.

ALTER TABLE tasks
ADD COLUMN IF NOT EXISTS branched_from_task_id UUID REFERENCES tasks(id) ON DELETE SET NULL;

CREATE INDEX IF NOT EXISTS idx_tasks_branched_from ON tasks(branched_from_task_id);

COMMENT ON COLUMN tasks.branched_from_task_id IS 'Source task ID when this task was branched from another task conversation';