Why the blog?

To record development problems and hopefully subsequent solutions when working on an ongoing Java project.

When I started on this project, it was already 5 years old. I thought it would be useful see how introducing some XP techniques might help reduce some unwanted artifacts

A test-driven re-write would be my preference, but as is so typical, this has been ruled out as too much work.

So, hopefully continuous gradual change in the right direction will help.

Thursday, June 26, 2008

DbDeploy
I wanted to introduce DbDeploy to get the database integrated into our continuous build process. This is to avoid the bottleneck of pre-release sql-script gathering by the DBA.
It turns out that that there is an existing perl script that is used to execute all the sql scripts and has useful features like templates - useful for creating audit triggers from table column meta data.
So I stole a few ideas from DbDeploy and augmented the migration script to do these features.
The new features required were,
  • Ensuring all sql scripts are under source control
  • Storing a log of each sql script executed in a table in the DB
  • Comparing source control with table log to only apply new scripts
  • Detecting if previously executed sql scripts have been changed in source control and triggering complete restore from last nights prod backup.
  • Failing cruise build on any sql errors
Now, with database continuous integration, app always works against db. No manual compilation of sql scripts is needed, all database changes comply with database integrity rules and naming conventions (cos of DB unit tests in build)

No comments: