schambers/fluentmigrator — pull request #414 by daniellee (2013-05-21 17:44:06+00:00)
Title: Expose connection string in a migration. Closes #240

The connection string that is passed into the runner is now exposed as a property in the MigrationBase class.

I need a bit of feedback on this. This works as long as the connection string is set on the RunnerContext. This happens with the three runners (console, Nant and MSBuild) but for those who go directly against the MigrationRunner class then it has to be set on the RunnerContext that is then passed into the ctor of MigrationRunner.

The other way to do it would be to fetch the connection string from the Processor class. This is always set otherwise it is impossible to execute against a database. The problem is that the code for this is a bit more complicated. The JetProcessor has an oledb connection whereas all the other processors have an IDBConnection and I'd have to cast the processor to GenericProcessorBase or to JetProcessor. So it's all a bit messy but it would be guaranteed to be the real connection string.

What do you think?