Skip to content

Commit

Permalink
needed to fix the UpgradeToLatest, realized it had a potential index …
Browse files Browse the repository at this point in the history
…issue
  • Loading branch information
unknown committed Aug 29, 2009
1 parent d01edde commit 3a587a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FluentMigrator.Runner/MigrationVersionRunner.cs
Expand Up @@ -222,13 +222,15 @@ public void UpgradeToVersion(long number, bool autoRollback)
/// <param name="autoRollback"></param>
public void UpgradeToLatest(bool autoRollback)
{
if (this.Migrations == null || this.Migrations.Count == 0) return;

//upgrade to latest
long latestVersion = this.Migrations.Keys[this.Migrations.Keys.Count - 1];

//exit early if already at current verions
if (latestVersion == CurrentVersion) return;

this.UpgradeToVersion(latestVersion, false);
this.UpgradeToVersion(latestVersion, autoRollback);
}

public void SaveVersionState(long currentVersion, long previousVersion)
Expand Down

0 comments on commit 3a587a5

Please sign in to comment.