This section describes how to do cascading deletes before Prisma version 2.26.0. If you use version 2.26.0 or later, we recommend that you do cascading deletes with Referential actions.

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.

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