Skip to content

Commit

Permalink
Prisma: Fix failed to delete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Jun 26, 2024
1 parent f3fcb1d commit 83ba1c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-llamas-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuma-comment/prisma-adapter": patch
---

Fix failed to delete comments
2 changes: 1 addition & 1 deletion apps/docs/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model Rate {
commentId Int
like Boolean
comment Comment @relation(fields: [commentId], references: [id])
comment Comment @relation(fields: [commentId], references: [id], onDelete: Cascade)
@@id([userId, commentId])
@@index([commentId])
Expand Down
2 changes: 1 addition & 1 deletion packages/prisma-adapter/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ model Rate {
commentId Int
like Boolean
comment Comment @relation(fields: [commentId], references: [id])
comment Comment @relation(fields: [commentId], references: [id], onDelete: Cascade)
@@id([userId, commentId])
@@index([commentId])
Expand Down

0 comments on commit 83ba1c4

Please sign in to comment.