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.

In 3.0.1 and later it is possible to do cascading deletes using Referential actions. Be sure to follow the upgrade guide before using this feature.

cascading deletes illustration

Edit this page on GitHub