fix(structures): align Structure.delegation_code FK action with Prisma default #229
@@ -83,9 +83,13 @@ ALTER TABLE "delegations" ADD CONSTRAINT "delegations_region_code_fkey"
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
-- ON DELETE SET NULL because delegationCode is optional in the Prisma
|
||||
-- schema (Structure.delegation Delegation?). Matches Prisma's default
|
||||
-- for nullable relations; the drift gate would otherwise flag this
|
||||
-- on every `prisma migrate dev`.
|
||||
ALTER TABLE "structures" ADD CONSTRAINT "structures_delegation_code_fkey"
|
||||
FOREIGN KEY ("delegation_code") REFERENCES "delegations"("code")
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- ------------------------------------------------------------------
|
||||
-- Test-tenant reference seed (per ADR-0027 §"Seeding posture").
|
||||
|
||||
Reference in New Issue
Block a user