migra
migra copied to clipboard
Data migrations?
First of all, thanks x1000 for making this awesome tool! My company's db migrations run on this and it works really well.
I was wondering if you have any ideas for how you could migrate data as well as schemas. This would be super useful at times - for example when migrating a production database to a new version for example.
I understand this would be a formidable technical task but wondering if this is on a roadmap? Or if you have seen any alternative tools that can fill this niece?
migra won't do this I think.
if you need for example to change column name then migra (currently) have no way to guess it, you need to change outputed diff sql yourself.
I am just starting on my research about schema migration tools and it completely puzzles me what the idea of the automatic schema diff/patch approaches is if they all neglect the not so theoretical possibility that you also need data migrations. Honest question: What is your approach if previously you were using an unstructured blob of text to store postal addresses and want to switch to separate columns for street / house number / ZIP / city / country? With just applying the schema patch, you would just lose all postal address data, right? Am I missing something? If you propose to do these steps by hand, you will end up with a pretty hard-to-maintain mix of simpler schema diffs and more complex data migration steps. This seems not to be a simplification over just a single scheme of migration scripts and it makes it non-feasible to just store the respective data-base-schema in version control.