Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 23:42:18 +00:00
co-authored by renee-png
parent 7a0fb314c3
commit e4b17c1f8c
2 changed files with 44 additions and 0 deletions
@@ -0,0 +1,14 @@
-- Add template_task_id to tasks for sequential chaining
ALTER TABLE public.tasks
ADD COLUMN IF NOT EXISTS template_task_id uuid REFERENCES public.workflow_template_tasks(id) ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_tasks_template_task ON public.tasks(template_task_id);
-- Allow workflow_templates on collections too
ALTER TABLE public.collection_tasks
ADD COLUMN IF NOT EXISTS workflow_template_id uuid REFERENCES public.workflow_templates(id) ON DELETE SET NULL,
ADD COLUMN IF NOT EXISTS template_task_id uuid REFERENCES public.workflow_template_tasks(id) ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_collection_tasks_workflow_template ON public.collection_tasks(workflow_template_id);
CREATE INDEX IF NOT EXISTS idx_collection_tasks_template_task ON public.collection_tasks(template_task_id);