Hello guys, wanted to ask about cascading deletes:...
# orm-help
j
Hello guys, wanted to ask about cascading deletes: There are 4 ways to handle it with prisma2 as I see: 1. Manually set it up in the db. 2. Use plugin like this: https://paljs.com/plugins/delete/. But it’s slower I suppose. 3. Implement cascading deletes functionality in the resolvers. 4. Also I thought about creating a migration without applying it with
prisma migrate dev --createOnly
than manually modify it to set cascading deletes, kind of like the variant #1 but that way I save it and can apply later to any db (test, staging, prod, etc) Can you please suggest what would be the optimal solution ? Thank you.
j
Go with option 1, we will soon ship a preview feature that will add support for picking these up in the schema and then fully manage them in Prisma.
(soon as in possibly next week)
j
When cascading deletes are gonna be fully managed by prisma ? It’s just I’ve got a few DBs with which I test my transition from prisma1 to prisma2. After I complete it I’ll need to apply it to a production database. And personally don’t want to set it up manually in all of the databases. But if it’s gonna be released soon, I think I’d better wait for it. Maybe some estimates for a production ready support for the cascading deletes ?
j
Production ready is very hard to say, but we are pretty confident in the preview feature already that will be released really soon.
This is the issue that will be updated when it is available: https://github.com/prisma/prisma/issues/7816
j
Understood, thank you.
👍 1