Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to cascade delete things? #201

Closed
maaft opened this issue Jul 17, 2020 · 1 comment
Closed

How to cascade delete things? #201

maaft opened this issue Jul 17, 2020 · 1 comment

Comments

@maaft
Copy link

maaft commented Jul 17, 2020

How can we cascade delete things?

E.g.

model User {
   id           String  @id
   posts     Posts[]
}

model Post {
   id           String @id
   user       User @relation(fields: [userId], references: [id])
   userId    String
}

When calling the deleteUser mutation I also want to delete all posts and sub-sub-sub-relations.

@steebchen
Copy link
Owner

This is probably a Prisma schema and migrate issue, please see prisma/prisma#2810 for details and follow for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants