is there a way to `deleteMany()` including relatio...
# orm-help
n
is there a way to
deleteMany()
including relationships, like you have a
User
which has many
Address
and I want to delete the user and all of their addresses? or do you have to cascade delete each in a transaction? 🤷
s
You may have to delete each in a transaction
c
I seem to remember they added to the Prisma schema the ability to set your desired cascade type for each relation.
r
@n 👋 You can use
onDelete: Cascade
as specified here which will automatically delete the relations when you delete the parent record 🙂
n
SWEEEET @Ryan i added loads of bullshit logic to cascade manually, i'll add this cheers mate
🚀