Recognises a referential action destroying what should survive
ON DELETE CASCADE or SET NULL on a relationship whose child has a life of its own. A deletion anomaly made automatic: deleting one fact silently deletes or erases another.
Can AI do this?
Not tested yet
No AI benchmark covers this knobit yet. New results are announced in the Can AI Do the Job? newsletter.
What it looks like in practice
Expected result: The action and the child to keep
How it is assessed: Flags the deficient case and passes the acceptable one. Deficient: fk_payment_account with on_delete: cascade: purging a closed account deletes its payments and holds. fk_payment_authorised_by with set null: deleting a user erases who authorised the payment Acceptable: on_delete: restrict by default; cascade only for children that cannot exist without the parent (an instalment with its repayment schedule), with the data rule cited
Also known as: Referential action deletes or erases what should survive (physical model)
Related knobits
Builds on
- K-503 Recognises a deletion anomaly in a logical data model
- K-653 Explains referential integrity and referential actions
All 40 knobits of Design the physical data model.
Source: Review checklist 06-physical, row 13; Codd 1979 §2.1; E&N 6.2; Codd 1971