OverviewThe Carbon Five Database Migration framework and maven plugin provides a simple solution to problem of managing discrete, incremental changes to databases over time across multiple environments. Each migration is versioned and tracked when
... [More]
applied to the database. Sensible defaults reduce the amount of necessary configuration, though the framework can be configured and extended. Before this google code page, this framework was announced on our Community Blog.
Key Maven Plugin Goals Goal Description db-migration:createCreate a new, empty database db-migration:migrateApply all pending migrations db-migration:resetDrop the existing database, create a new one, and apply all pending migrations
Sample Maven Plugin Configuration...
com.carbonfive
maven-db-migration-plugin
RELEASE
jdbc:mysql://localhost/myapp_test
dev
dev
mysql
mysql-connector-java
5.1.6
c5-public-repository
http://mvn.carbonfive.com/public
...Other DetailsBy default, migrations are loaded from the directory src/main/db/migrations and follow the naming convention yyyymmddhhmmss_some_description.sql. Version history is stored in the database in the schema_version table, which captures the version, date-applied, and how long it took for the migration to execute for each applied migration.
Supported DatabasesAll functionality is supported for MySQL, PostgreSQL, and H2Database, though the migrate functionality is likely to work with many other database systems. Create/drop/reset are less likely to work out of the box. Our goal is to support all of the major database systems and we're eager to hear how it works with other systems. MS SQL Server is on the short list and will likely be supported very soon.
DocumentationCheck out the Maven Plugin Guide if you're interested in manually triggering database updates. If you want to embed the migration framework in your application, check out the Application Embedding Guide. [Less]