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
No comments:
Post a Comment