Merge branch 'worktree-agent-acdb74a3'

This commit is contained in:
2026-04-09 14:18:27 +02:00
3 changed files with 14 additions and 1 deletions
@@ -0,0 +1,4 @@
-- Migration: Add composite indexes on Assignment for capacity range queries
CREATE INDEX IF NOT EXISTS "assignments_resourceId_status_endDate_idx" ON "assignments"("resourceId", "status", "endDate");
CREATE INDEX IF NOT EXISTS "assignments_projectId_status_endDate_idx" ON "assignments"("projectId", "status", "endDate");
@@ -0,0 +1,7 @@
-- Migration: Add SetNull cascade on Assignment → DemandRequirement FK
-- When a DemandRequirement is deleted, assignments lose their reference but are not deleted.
ALTER TABLE "assignments" DROP CONSTRAINT IF EXISTS "assignments_demandRequirementId_fkey";
ALTER TABLE "assignments" ADD CONSTRAINT "assignments_demandRequirementId_fkey"
FOREIGN KEY ("demandRequirementId") REFERENCES "demand_requirements"("id")
ON DELETE SET NULL ON UPDATE CASCADE;