13 lines
391 B
MySQL
13 lines
391 B
MySQL
|
|
-- AP1.5d: Rekursive Tasks unter Action
|
||
|
|
|
||
|
|
ALTER TABLE tasks
|
||
|
|
ADD COLUMN IF NOT EXISTS parent_task_id UUID NULL
|
||
|
|
REFERENCES tasks (id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_tasks_parent
|
||
|
|
ON tasks (tenant_id, parent_task_id)
|
||
|
|
WHERE parent_task_id IS NOT NULL;
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_tasks_action_parent
|
||
|
|
ON tasks (tenant_id, action_id, parent_task_id);
|