2007-09-21

Managing versions of a database

There are in SQLServer2005 ways to version control it through tools by Microsoft. Since I havn't had the time to learn how to and some of us use other databases there is a common technique that works so so but at least gives us a chance of reverting to an older version.

Any time I decide that this is version x.y. I check in the database as binary. Image or backup doesn't matter as long as it is recreateable without anything else.
After that all updates must be scripted. These scripts are checked in in the same folder as the database.
One can then get the database and use the date stamps on the scripts to get the exact version of the database.

After a while there are too many scripts so we check in the database again.

One then sorts the files on date and starts by getting the database. Then run the scripts to the proper version.

This is not a perfect way; it is easy to forget to script a change. But it is a start at least.

No comments: