Files
vadimandClaude Opus 5.5 2696f33a7e 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>
2026-10-01 11:23:51 +03:00

15 lines
567 B
SQL

-- 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;