views:

86

answers:

2

Hi guys,

Brief introduction: I have this ASP.NET Webforms site with the particularity that it doesn't have only 1 database, it has many. Why? Because you can create new "instances" of the site on-the-fly. Every "instance" share the same codebase, but has its own database. These all databases have the same schema (structure) but of course different data. Don't ask 'why don't you put everything in one database and use InstanceId to know which is" because it's a business policy thing.

The application knows which instance is being requested because of the url. There is one extra database to accomplish this (I do know its connection string in design time). This database has only 2 tables and associates urls to 'application instances'. Then, of course, each 'application instance' has its associated connection string.

Current situation: There is nothing being used right now to help us with the job of mantaining every instance database in sync (propagating schema changes to every one). So we are doing it by hand, which of course it's a total mess.

Question: I'd like to use a rails-migration way to handle schema changes, preferably migratordotnet, but could use any other if it's easier to setup.

The problem is that migratordotnet needs the connnection string to be declare in the proj.build file and I don't know them until runtime.

What it would be REALLY useful is some kind of method running on *Application_Start* that applies the latest migration to every database.

How could this be done with migratordotnet or any similar? Any other suggestion is thanksfully welcomed.

Thank you!

A: 

Check out Fluent-Migrator.

mxmissile
Judging by the release files seems based on MigratorDotNet. The documentation is pretty poor yet and I really don't know how to run migrations from a list of databases I get at Application_Start.
emzero
+1  A: 

RedGate has a SQL Comparison SDK that could be used. Here is a Case Study that looks promising, but I can't tell you anthing from experience as I haven't used it. Download the trial and kick the tires.

Larry Smithmier
+1 - Red Gate's SQL comparison / migration tools are excellent. I've not used their SDK but if it's anything like their developer tools, it should be exactly what you're looking for.
Dylan Beattie
I guess I've forgot to mention I needed something free. Anyway RedGate approachs seems similar to VS: Database Tools... which I don't really like.I'm just looking for something like Rails Migrations, which already exists for .NET, but need to make it work with multiple databases known at runtime...
emzero