schambers/fluentmigrator — pull request #304 by kieranmaine (2012-09-20 12:07:25+00:00)
Title: New ValidateVersionOrder task to ensure consistent ordering of migrations between environments

We have a situation where the order that migrations get applied can differ between databases depending on when branches are merged into out trunk.

This means that the order in which migrations are applied to our QA environment might differ to the order they're applied to our Production environment. 99% of the time this may not be an issue, but to ensure we isolate all issues at the QA stage we want to have migrations run consistenstly across environments.

To help solve this issue I've added a "validateversionorder" task to the MigrationRunner, which can be called from the all runners.

This will throw an exception if there are any unapplied migrations with a version that is less that the current greatest version of applied migrations. The exception lists all migrations that fail this condition.

We use this task in TeamCity to fail the build when committing to trunk. The developer then has to reorder the migrations so they run consistenly across environments.