Skip to content

Commit 93dc9e5

Browse files
committed
Allow metric dashboards to have no owner, in case the user gets deleted
1 parent a105b79 commit 93dc9e5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable: make ownerId nullable to match ON DELETE SET NULL foreign key
2+
ALTER TABLE "public"."MetricsDashboard" ALTER COLUMN "ownerId" DROP NOT NULL;

internal-packages/database/prisma/schema.prisma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,8 +2559,8 @@ model MetricsDashboard {
25592559
projectId String?
25602560
25612561
/// Who created the dashboard
2562-
owner User @relation(fields: [ownerId], references: [id], onDelete: SetNull, onUpdate: Cascade)
2563-
ownerId String
2562+
owner User? @relation(fields: [ownerId], references: [id], onDelete: SetNull, onUpdate: Cascade)
2563+
ownerId String?
25642564
25652565
createdAt DateTime @default(now())
25662566
updatedAt DateTime @updatedAt

0 commit comments

Comments
 (0)