cascade-delete (CT002)#
Automatic fix is available.
What it does#
Checks for usage of cascade update.
Why not?#
Database schema should follow the principle of least surprise which says that every component in a system should behave in a way that most users expect it to behave, and therefore not surprise or astonish them.
Cascading deletes should not cause unexpected loss of data. It is certainly dangerous if deleting a single table row can wipe out half your database.
Are you certain you want to take the chance that someone will delete a single reference entry, unaware that doing so may delete a billion related transactions?
When should you?#
Almost never.
Use instead:#
Restrict