4 ms·
How are foreign keys and deleted_at mutual exclusive?
by stop50 3y ago
How are foreign keys and deleted_at mutual exclusive?
- dspillett 3y agoI assumed cube2222 meant where soft-delete wasn't universal: so you might really delete the parent row but want to soft-delete the child rows. Though I would suggest this is a bad idea: if you want to soft-delete child rows you should enable it on parent rows too.
- cube2222 3y agoE.g. you want to have a foreign key that makes sure the “singular” side of a one-to-many relationship isn’t soft-deleted as long as it has anything in the “many” side. Both sides using soft-deletion.