4 ms·
There are various database agnostic schema migration tools that can help. There are rails, django and laravel migrations or alembic if you use python/sqlalchemy
by aregsarkissian 9y ago
There are various database agnostic schema migration tools that can help. There are rails, django and laravel migrations or alembic if you use python/sqlalchemy. There also pure sql based migration systems such as flyway. There is a great pluralsight course on proper way to do migrations using flyway. Most of it applies to migrations with any migration tool. You might be able to check it out with the free trial. But basically you want to do all your add columns and add tables before deploying a new version of code. Just to make sure the old version still runs. Then after deploying the new version of code. at some point you can delete the unused columns and tables. I also like to have one database object per migration file. That way the cost of each migration is smaller and if the migration fails you don't have to fix a partial migration since each migration operation is atomic.
- w4tson 9y agoI really like flyway. It’s lightweight and the best thing I can say about it is that I rarely have to bother with it. It just works. I too find it useful to keep the migrations small and succinct. For Oracle do migrations where the DDL cannot be rolledback I choose to separate these from straight data manipulation. A downside to the project that I see is that although it’s quite mature the author is very very slow to engage with open source modifications. I’d still make it my first choice because of its simplicity.