4 ms·
How do you manage referential integrity? If you have 2 tables, A and B, where B references A Ideally I couldn't set deleted on row in A until all the rows in B
by NickNameNick 11y ago
How do you manage referential integrity?
If you have 2 tables, A and B, where B references A
Ideally I couldn't set deleted on row in A until all the rows in B that reference it have also been set to deleted.
If I wasn't using soft deletes, I'd just use a foreign key from B (a_id) to A (a_id), but with soft-deletion, that constraint doesn't get enforced.