Skip to content

Commit

Permalink
var name
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed May 20, 2023
1 parent 6e60936 commit 9ac2ab8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions up.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func UpTo(db *sql.DB, dir string, version int64, opts ...OptionsFunc) error {
if err != nil {
return err
}
currentVersion := dbMigrations[len(dbMigrations)-1].Version
dbMaxVersion := dbMigrations[len(dbMigrations)-1].Version
// lookupAppliedInDB is a map of all applied migrations in the database.
lookupAppliedInDB := make(map[int64]bool)
for _, m := range dbMigrations {
Expand Down Expand Up @@ -96,7 +96,7 @@ func UpTo(db *sql.DB, dir string, version int64, opts ...OptionsFunc) error {
if lookupAppliedInDB[m.Version] {
continue
}
if m.Version > currentVersion && m.Version <= version {
if m.Version > dbMaxVersion && m.Version <= version {
migrationsToApply = append(migrationsToApply, m)
}
}
Expand Down

0 comments on commit 9ac2ab8

Please sign in to comment.