Keep issues when assignee or reporter is deleted
Switch issue.assigneeId/reporterId FKs from CASCADE to SET NULL and make reporter nullable through the entity, DTOs and GraphQL types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b8c855855
commit
2696f33a7e
8 files changed
+31
-21
No files matched your search
@@ -0,0 +1,14 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "issue" DROP CONSTRAINT "issue_assigneeId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "issue" DROP CONSTRAINT "issue_reporterId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "issue" ALTER COLUMN "reporterId" DROP NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "issue" ADD CONSTRAINT "issue_assigneeId_fkey" FOREIGN KEY ("assigneeId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "issue" ADD CONSTRAINT "issue_reporterId_fkey" FOREIGN KEY ("reporterId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
Reference in new issue
Block a user