I am a build engineer and responsible for our source control layout. We need to keep a version of all database objects and also group changes together with rollback scripts for pushes to production. We have development, QA, and Production environments and there are different versions of the database objects in each. One area we have trouble is with table creates vs alters. Developers will check in alters but to recreate the database we need the creates. Any ideas would be appreciated.
You should look into how frameworks like rails handle migrations
http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations
This article should answer most if not all questions
http://odetocode.com/Blogs/scott/archive/2008/01/30/11702.aspx
I'm a huge fan of http://www.liquibase.org/. It allows you to track versions of your database, including the ability to "update" and "rollback" your schema/data.
They have a nice XML syntax that has baked in support for common refactorings, including ones detailed in http://databaserefactoring.com/
They also have Eclipse plugins to help create the change scripts, and ant task's for integrating into your build.
My only complaint is that it is Java based and I'm fond of installing java on my build server for .NET projects. In that case I've heard good things about http://code.google.com/p/migratordotnet/.
Have you checked this previous question? http://stackoverflow.com/questions/778317/need-a-better-way-to-manage-database-schema-changes
I can recommend you such scenario:
- Dbunit for data population (e.g. dictionaries, masterdata and other critical database information)
- Liquibase of dbdeploy for database refactoring. In my mind liquibase is more refactoring oriented tool and dbdeploy - more process oriented (i.e. you have to do more by hands, but it simplify development, testing and production support process).
If you company are using ORM, you can create database schema "diff" on the fly based on the ORM engine. Besides, if your product works with different databases, you'll have additional level of complexity. Unfortunately, neither dbdeploy, nor liquiase satisfied me for multy-database development/refactroing.