forked from bai/curriculum-project-hub
fix(hub): cascade agent-config folder parent deletes
parentId RESTRICT prevented Organization.deleteMany from clearing nested folder trees during test resetDb, leaving half-wiped rows and breaking subsequent upserts. Service still refuses non-empty folder deletes; DB cascade only unblocks org teardown / full wipe.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- Allow Organization wipe/cascade to clear nested agent-config folders.
|
||||
-- Service layer still refuses non-empty folder deletes (ADR-0028); this only
|
||||
-- unblocks parent-row removal during org teardown and test resetDb.
|
||||
ALTER TABLE "OrganizationAgentConfigFolder" DROP CONSTRAINT "OrganizationAgentConfigFolder_parentId_fkey";
|
||||
ALTER TABLE "OrganizationAgentConfigFolder" ADD CONSTRAINT "OrganizationAgentConfigFolder_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "OrganizationAgentConfigFolder"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user