This week in review has a surprise at the end after all of the work stuff.
It’s been another busy week at work – trying to get our latest offering out the door. We hit a snag when moving our database from dev to stg. A dba came in groggy and deleted our development db by mistake. All of our work was based off of this db. At my urging, we had our stored procedures under source control and continuous integration, but the table definitions and data weren’t.
Bit of a tense time until we got Thursday night’s backup restored.
I got to show my coworkers the benefits of learning new langugages. Ruby on Rails has a really good approach to this issue. In RoR you write your table definitions, etc. in ruby code in a series of files. As you make changes you add files.
001_create_products.rb
002_add_price.rb
003_add_test_data.rb
004_add_sessions.rb
Each file has a roll out section and a roll back section.
For the next project at work I’m going to approach it in a similar way. We run off of cruise control and subversion, not rake, but I think we could have a similar method. You have a directory with database scripts. Every time you want to change the database, you add a script. CruiseControl picks up the script, runs only the new scripts in the directory. If the script fails, it rollsback these changes and runs the rollback scripts.
In other news, I was chopping wood with an ax up at Matt Scott’s lake house this weekend and I chopped my foot instead of wood. I’ve got some stitches and all of my toes, which is nice. I’m working from home because walking is no longer fun.