Kairo-Jinkendo/backend/migrations/014_project_hierarchy.sql
Lars 4ca0a2c460
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Successful in 1m42s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 21s
Test Suite / playwright-smoke (push) Successful in 14s
AP1.5c: Rekursive Projects fuer Mega-Programme ohne Stream-Typ.
parent_project_id und container_kind ermoeglichen verschachtelte Projektstruktur; Arbeitspakete bleiben an Blatt-Projekten gebunden.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 08:38:58 +02:00

13 lines
476 B
SQL

-- AP1.5c: Rekursive Projects (parent_project_id, container_kind)
ALTER TABLE projects
ADD COLUMN parent_project_id UUID NULL REFERENCES projects(id) ON DELETE SET NULL,
ADD COLUMN container_kind VARCHAR(32) NULL
CHECK (
container_kind IS NULL
OR container_kind IN ('project', 'stream', 'phase', 'release')
);
CREATE INDEX idx_projects_parent ON projects(tenant_id, parent_project_id)
WHERE parent_project_id IS NOT NULL;