DatabaseNG - Migrations Revisited
database deployment java migration sql
Half way through last year I came up with a simple 'framework' for handling automated database migrations, I've been using this in one project at ${work} for the last year and its worked wonders, for both production deployments and repeatable unit tests. Mixing the migrations with live spring/hibernate testing it's certainly given me more peace of mind about the deployment of that project.
Recently I moved onto a different project at ${work} that had a set of neglected tests that no longer run as part of the build (or passed) so my first port of call was getting the tests running and passing, and creating a fresh integration database for testing.
The code from this was based on the original migration code with .java files simply lifted from the old project; this got me thinking that it should be a library and reused rather than just copied. At the same time I started thinking of better/different ways of handling the migration process. The result of this is the cheesily named "DatabaseNG" - the name kinda sucks but I couldn't really think of anything cool - and 'dbng' as a nice ring to it. I suppose I could come up with amusing concept of "Next Generation" being implied by database migrations...
The codes hosted on Google Code and a short intro posted to the wiki. The new iteration of the framework feels somewhat like TestNG in its use of annotations, and seems to work nicer than separate classes per migration.
I'm not sure where this will go, but it'll be interesting to see how useful it becomes.
Comments (2)
Downloaded the source and took a look. I'm integrating it with a spring layer right now and seeing if I can get it to work in my blog -- I added my thoughts as issues. Hope it helps. :-)
Cheers for the feedback, I've got some other feedback about improvements to remove duplicating information on the annotations. A s for the feedback/issues - the original version was driven from Spring passing in a DataSource and I was intending to keep that ability, either by adding an openDatabase(DataSource ds) along side the createDatabase() or some other means.