Skip to content

Commit

Permalink
Bug fix StartVersion Migrate() command
Browse files Browse the repository at this point in the history
  • Loading branch information
lecaillon committed Jun 28, 2017
1 parent f8b2841 commit c628a83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Evolve/Evolve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ public void Migrate()

var metadata = db.GetMetadataTable(MetadataTableSchema, MetadataTableName);
var lastAppliedVersion = metadata.GetAllMigrationMetadata().LastOrDefault()?.Version ?? MigrationVersion.MinVersion;
var startVersion = metadata.FindStartVersion(); // Load start version from metadata
var scripts = _loader.GetMigrations(Locations, SqlMigrationPrefix, SqlMigrationSeparator, SqlMigrationSuffix)
.SkipWhile(x => x.Version < startVersion)
.SkipWhile(x => x.Version <= lastAppliedVersion)
.TakeWhile(x => x.Version <= TargetVersion);

Expand Down

0 comments on commit c628a83

Please sign in to comment.