Search code examples
asp.netrakedatabase-versioning

Rake Strategy, DotNet Implementation


When reading about and playing with Rails last year, one of the tools that made the biggest impression on me was Rake. A database versioning system that keeps all dev db's identical integrated right into the build...something like that would make life so much easier (and safer)!

However, one of the things that I haven't been able to figure out: How do you move these changes to your production servers when you don't actually have access to the production servers? We have multiple servers across the country that where the application is installed/upgraded by a setup package.

Note: This question is more about strategy than Rails/Rake specific technologies. We don't use rails, we use .Net. But if I can figure out this publish scenario, there seem to be several tools Migratordotnet being one that might enable us to do something similar.


Solution

  • As you probably know, the standard Rails way of running migrations in production is Capistrano. It has a deploy:migrations task that runs the migrations on remote servers using ssh.

    You might be able to adapt Capistrano to do what you want. It's essentially a flexible way to run commands on groups of remote servers. You need to have Ruby installed on the machine you are deploying from in order to use it, but not on the machines you are deploying to.

    Your best option may be to write a custom Capistrano task to upload the setup.exe, run it, then run the migrations (perhaps using Migrator.NET).