From 7af8561677cfdcfd23d099a25783c7fef51d1ba6 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 29 Jan 2026 02:30:16 +0000 Subject: Fix worktree cleanup to not run for shared worktrees --- .../migrations/20260129000000_add_supervisor_worktree_task_id.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 makima/migrations/20260129000000_add_supervisor_worktree_task_id.sql (limited to 'makima/migrations') diff --git a/makima/migrations/20260129000000_add_supervisor_worktree_task_id.sql b/makima/migrations/20260129000000_add_supervisor_worktree_task_id.sql new file mode 100644 index 0000000..974644c --- /dev/null +++ b/makima/migrations/20260129000000_add_supervisor_worktree_task_id.sql @@ -0,0 +1,7 @@ +-- Add supervisor_worktree_task_id column to tasks table. +-- When set, indicates this task shares the worktree of the specified supervisor task +-- and should NOT have its worktree deleted during cleanup (the supervisor owns the worktree). +ALTER TABLE tasks ADD COLUMN supervisor_worktree_task_id UUID REFERENCES tasks(id) ON DELETE SET NULL; + +-- Create index for efficient lookups +CREATE INDEX idx_tasks_supervisor_worktree_task_id ON tasks(supervisor_worktree_task_id) WHERE supervisor_worktree_task_id IS NOT NULL; -- cgit v1.2.3