From 8a6bd89a214ce7a8a5c4c87d9e1f25f4f3c06dd4 Mon Sep 17 00:00:00 2001 From: PleBea Date: Sun, 14 Jul 2024 05:19:33 +0900 Subject: [PATCH] refactor: Update Place and Invite models to cascade delete on related entities --- prisma/schema.prisma | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 27cb755..4d3f895 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -58,14 +58,14 @@ model Place { x String y String planId String @unique - Plan Plan @relation(fields: [planId], references: [id]) + Plan Plan @relation(fields: [planId], references: [id], onDelete: Cascade) } model Invite { id String @id @default(uuid()) planId String - Plan Plan @relation(fields: [planId], references: [id]) + Plan Plan @relation(fields: [planId], references: [id], onDelete: Cascade) userId String @unique - User User @relation(fields: [userId], references: [id], onDelete: Cascade) + User User @relation(fields: [userId], references: [id]) createdAt DateTime @default(now()) }