2 ms·
You can write the code to do 1000 schema migrations, but the problem is if you've migrated 40% of them and hit an issue. What do?
by robertlagrant 5y ago
You can write the code to do 1000 schema migrations, but the problem is if you've migrated 40% of them and hit an issue. What do?
- spookthesunset 5y agoOne of the many reasons to put good constrains on fields and use referential integrity! If you don't let the database enforce data validity you are gonna get fucked at some point! source: every single place I've worked at that poo-poos referential integrity has a database that is full of bullshit that "the application code" never cleaned up Always use referential integrity. The people who are against it almost always are against it for superstitious reasons (eg: "it makes things slow" or "only one codebase calls it so the code can enforce the integrity"). All it takes is exactly one bug in the application code to corrupt the whole damn thing. And that bug will happen over the lifetime of the product regardless of how "good" or "awesome" the programmers think they are.... ... I'll get off my soapbox now!
- robertlagrant 5y agoThat's one thing yes. What if there's a transient network error, or the DB runs out of memory, and now you have some data in an old state and some in a new. You're lecturing about table design. I'm talking about more general transactionality over any errors.