private static void Run() { // create migration table (if it does not exist) _migrationManager.InitMigrationTable(); // retrieve current version MigrationVersion currentVersion = _migrationManager.GetCurrentVersion(); // retrieve sql migration scripts to run MigrationScript[] _artifactScripts = _migrationScriptConverter.GetMigrationScripts(_migrationScriptsFolder, _settings.IncludeSubFolders); if (_artifactScripts == null || !_artifactScripts.Any()) { Exit(_settings.DebugMode, "No sql migration scripts found", _artifactContentFolder); return; } MigrationScript[] scriptsToRun = GetScriptsToRun(_artifactScripts, currentVersion); if (!scriptsToRun.Any()) { Exit(_settings.DebugMode, "Database is up to date, no upgraded required", _artifactContentFolder); return; } // run scripts foreach (MigrationScript script in scriptsToRun) { Console.WriteLine(string.Format("Applying migration {0} version", script.Version.ToString())); _migrationManager.Upgrade(script); Console.WriteLine(string.Format("Migration {0} version done", script.Version.ToString())); Console.WriteLine(); } currentVersion = _migrationManager.GetCurrentVersion(); Exit(_settings.DebugMode, string.Format("Database version = '{0}'", currentVersion.ToString()), _artifactContentFolder); return; }