One of the more difficult things to manage in software projects is often changing a database schema over time. On the projects that I work on, we don't usually have DBAs who manage the schema so it is left up to the developers to figure out. The other thing you have to manage is applying changes to the database in such a way that you don't disrupt the work of other developers on your team. We need the change to go in at the same time as the code so that Continuous Integration can work.
Migrations
While I don't know if they were invented there, migrations seem to have been popularized by Ruby on Rails. Rails is a database centric framework that implies the properties of your domain from the schema of your database. For that reason it makes sense that they came up with a very good way of These are some example migrations to give you an idea of the basics of creating a schema.
001_AddAddressTable.cs:
02_AddAddressColumns.cs:
003_AddPersonTable.cs:
Run Your Migrations
The best way to run your migrations will be to integrate it into your build automation tool of choice. If you are not using one, now is the time.
MigratorDotNet supports MSBuild and NAnt.
MSBuild:
NAnt:
So You Want to Migrate?
Some more documentation and example are available MigratorDotNet. Some of the changes represented are still in an experimental branch that is in the process of being merged.