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
@@ -86,9 +86,9 @@ model Issue {
|
||||
status String
|
||||
priority Int @default(0)
|
||||
assigneeId String?
|
||||
assignee User? @relation(name: "assigneeIssues", fields: [assigneeId], references: [id], onDelete: Cascade)
|
||||
reporterId String
|
||||
reporter User @relation(name: "reporterIssues", fields: [reporterId], references: [id], onDelete: Cascade)
|
||||
assignee User? @relation(name: "assigneeIssues", fields: [assigneeId], references: [id], onDelete: SetNull)
|
||||
reporterId String?
|
||||
reporter User? @relation(name: "reporterIssues", fields: [reporterId], references: [id], onDelete: SetNull)
|
||||
projectId String
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
dueDate DateTime? @db.Timestamptz(3)
|
||||
|
||||
Reference in new issue
Block a user