Skip to content

Commit

Permalink
fix: 🐛 fix creator_id in not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yeukfei02 committed Jan 1, 2023
1 parent 0e73502 commit 0cc6424
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Warnings:
- Made the column `creator_id` on table `Incident` required. This step will fail if there are existing NULL values in that column.
*/
-- DropForeignKey
ALTER TABLE "Incident" DROP CONSTRAINT "Incident_creator_id_fkey";

-- AlterTable
ALTER TABLE "Incident" ALTER COLUMN "creator_id" SET NOT NULL;

-- AddForeignKey
ALTER TABLE "Incident" ADD CONSTRAINT "Incident_creator_id_fkey" FOREIGN KEY ("creator_id") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
2 changes: 1 addition & 1 deletion apps/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model Incident {
title String
description String
type IncidentType @default(MEDIUM)
creator_id String? @db.Uuid
creator_id String @db.Uuid
assignee_id String? @db.Uuid
status Status @default(NOT_ASSIGNED)
created_at DateTime @default(now())
Expand Down

0 comments on commit 0cc6424

Please sign in to comment.