4 ms·
I think you've misunderstood what ActiveRecord migration rollbacks are for. Nobody is 'blowing away' customer data. A couple use cases are: 1. During develop
by dyeje 8y ago
I think you've misunderstood what ActiveRecord migration rollbacks are for. Nobody is 'blowing away' customer data. A couple use cases are:
1. During development. Named that column wrong? Included a column you realize you don't need before you merge that branch? No problem! Just rollback, fix the migration, and do it again.
2. During deployment. It gives you a sane way to rollback a botched deployed.
- nurettin 8y agoNot to mention that there are enterprise tools for rolling back version changes including database migrations, and enterprises which enforce their use, so the rollback scripts are essential.
- mmt 8y ago> what ActiveRecord migration rollbacks are for Whatever their intended purpose (by the developers, I assume), that has no bearing on how they're actually used. > Nobody is 'blowing away' customer data. That's a remarkable claim. Although it wasn't ActiveRecord specifically, I've seen this happen with a similar migration/rollback mechanism. Granted, it was only a few hours of customer data, and it would not have existed in the first place were it not for the initial upgrade/migration (subsequently rolled back), but the data was accepted and subsequently lost. Good thing there weren't any SLAs (yet). > 2. During deployment. It gives you a sane way to rollback a botched deployed. Even this use case can fall into the data loss trap in my example above. What if nobody realizes the deployment was botched until hours later?