4 ms·
What you wrote is data migration. Table/database migrations are just DDL scripts which are usually really small on an ongoing project. For example you add 2 col
by ssijak 9y ago
What you wrote is data migration. Table/database migrations are just DDL scripts which are usually really small on an ongoing project. For example you add 2 columns in a sprint so you have that in the SQL migration file for that sprint.
- jbergens 9y agoA real project usually have a lot of things that changes over time, including how to store the data. Adding columns and tables are basically the only simple things and not even new tables are always easy if they are connected to other tables and you have contraints that means they have to be pre-filled with something from the old database. Other things that can change is splitting one table into multiple table while keeping all data, splitting or joining columns while keeping data and so on. For large datasets this may cause headaches. Any error will also cause a lot of extra work.
- dorfsmay 9y agoAdding a column is easy! What about removing a column? What about if you've decided that you both current and next version of the code to work (then removing a column is a 3 step process, copy to new and use new, skip a version, remove old). Migration can and is often hard.
- yoz-y 9y agoMigration is hard, but I fail to see how something like MongoDB makes this easier. Either you kick the can to the code, or do a migration script. Is there some magic style of coding that allows me to use the old data structures with the new code without having to do any special checks?