Cascading deletes allow you to define how foreign key relationships should be handled when you delete a record. For example, when you delete a user, you might use a cascading delete to remove that user's extended profile from a related table. By contrast, you might not want to delete that user's blog posts.

It is not yet possible to define cascading deletes in Prisma Schema Language - follow GitHub issue #2810 for updates and discussions. The guides in this section describe how to implement cascading deletes manually in the database and verify the results in Prisma Client.

cascading deletes illustration

Edit this page on GitHub