Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> This is one gripe I have with soft-deletion. Since I can no longer rely on ON DELETE CASCADE relationships

If you use soft deletes on all tables, you can also cascade them as long as you either cascade updates to the real keys as well, or prevent such updates, by having a deleted flag column on each table, including it in a unique constraint with the actual key column(s), and including it in the foreign key.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: