How can I implement this (cascade Delete) on prism...
# orm-help
a
How can I implement this (cascade Delete) on prisma2's
schema.prisma
file?
Copy code
type Post {
  id: ID! @unique
  comments: [Comment!]! @relation(name: "CommentToPost", onDelete: CASCADE)
  updatedAt: DateTime!
  createdAt: DateTime!
}
r
Hey @Ashiqur Rahman 👋 Currently Prisma 2 doesn't have support for cascade deletes. As a workaround you would have to add the cascade functionality at the DB level and then run
prisma introspect
to generate the schema accordingly. The feature request for this can be tracked here.
a
Also you can use my class to implement this feature https://prisma-tools.ahmedelywa.com/delete
💯 2