Skip to content

Commit 57150d9

Browse files
authored
fix: make createdById at Watchlist nullable (calcom#24033)
1 parent 8b75bf3 commit 57150d9

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- DropForeignKey
2+
ALTER TABLE "Watchlist" DROP CONSTRAINT "Watchlist_createdById_fkey";
3+
4+
-- AlterTable
5+
ALTER TABLE "Watchlist" ALTER COLUMN "createdById" DROP NOT NULL;
6+
7+
-- AddForeignKey
8+
ALTER TABLE "Watchlist" ADD CONSTRAINT "Watchlist_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

packages/prisma/schema.prisma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,8 +2268,8 @@ model Watchlist {
22682268
action WatchlistAction @default(REPORT)
22692269
severity WatchlistSeverity @default(LOW)
22702270
createdAt DateTime @default(now())
2271-
createdBy User @relation("CreatedWatchlists", onDelete: SetNull, fields: [createdById], references: [id])
2272-
createdById Int
2271+
createdBy User? @relation("CreatedWatchlists", onDelete: SetNull, fields: [createdById], references: [id])
2272+
createdById Int?
22732273
updatedAt DateTime @updatedAt
22742274
updatedBy User? @relation("UpdatedWatchlists", onDelete: SetNull, fields: [updatedById], references: [id])
22752275
updatedById Int?

0 commit comments

Comments
 (0)