From 9ac2ab806c6144f3f71bf4e4d9112f3f0f273c0c Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Sat, 20 May 2023 14:26:48 -0400 Subject: [PATCH] var name --- up.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/up.go b/up.go index 579b94cea..6d92f581e 100644 --- a/up.go +++ b/up.go @@ -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 { @@ -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) } }