DEV Community

[Comment from a deleted post]
Collapse
 
aarone4 profile image
Aaron Reese • Edited

The only thing worse than cascade delete is ending up with orphaned records. If no-one specifies the foreign key relationship in the database you can end up with order lines with no order address, or orders with no customer. I agree that RI (referential integrity) can be frustrating and perhaps engines could be smarter about checking the scope of the transaction but I'd rather have the delete fail than result in corrupted data.