MVN Database Migration

Want to try out an established open source database migrator instead of using our home-grown one, try out the c5-db-migration maven plugin!

On a recent project I was on, we traced an application failure back to an obscure bug in our our home-grown database migrator. There are drawbacks to rolling your own.

I needed a database migrator for an open source project I was working on. After doing a bit of research, I found an established open source database migrator called “c5-db-migration.” It grew out of Rails ActiveMigration if any of you are familiar with that.

It’s super-easy to use–just add a plugin to your maven pom file and you get access to these commands:

mvn db-migration:create Create a new, empty database
mvn db-migration:migrate Apply all pending migrations
mvn db-migration:reset Drop the existing database, create a new one, and apply all pending migrations
mvn db-migration:new Create a new, empty migration script

There is also a Java API if you want to auto-migrate at application startup.

Ken

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply