Referential integrity keeps your data clean. Except it doesn't. Not the way you think it does. And the tax you pay to work with a relational database?...
You can't unit test the database. Fine. Don't fight it. The best way to avoid a fight is to not be there. Here's what I actually do — and the part tha...