mirror of
https://github.com/spliit-app/spliit.git
synced 2025-12-06 01:19:29 +01:00
Add cascading delete behavior to activity.group. (#448)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Activity" DROP CONSTRAINT "Activity_groupId_fkey";
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "Activity" ADD CONSTRAINT "Activity_groupId_fkey" FOREIGN KEY ("groupId") REFERENCES "Group"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
@@ -116,7 +116,7 @@ model ExpensePaidFor {
|
|||||||
|
|
||||||
model Activity {
|
model Activity {
|
||||||
id String @id
|
id String @id
|
||||||
group Group @relation(fields: [groupId], references: [id])
|
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
||||||
groupId String
|
groupId String
|
||||||
time DateTime @default(now())
|
time DateTime @default(now())
|
||||||
activityType ActivityType
|
activityType ActivityType
|
||||||
|
|||||||
Reference in New Issue
Block a user