|
|
|
|
|
by awinter-py
3527 days ago
|
|
Hmm -- most migrations don't need to be reversed, not sure what the 'down' section does in those cases. The more important problem in DB migrations is transforming the content (usually involves application code) and resolving relational changes (i.e. 'in v2 all users are a member of a group'). Some large companies handle migrations by versioning the data and branching the code to handle every version. Another alternative is to 'migrate on read'. Both of those options sound worse on paper than an all-at-once migration but one-shot upgrades can be expensive and dangerous on large databases. Dealing with data-versions explicitly also makes sense for data that's stored client-side and periodically synced. |
|
This is true - but when something does break unexpectedly in a production migration, the last thing you want to do is figure out how to do your revert/'down' on the fly.