Skip to content

Commit 37a56c8

Browse files
authored
migrator: fix panic in upByOne when already migrated (#564)
1 parent 04a6a6d commit 37a56c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

migrations/migrator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (m *Migrator) upByOne(ctx context.Context, db bun.IDB) error {
298298
logging.FromContext(ctx).Debugf("Detected last version: %d", lastVersion)
299299

300300
// At this point, there is no pending migration occurring
301-
if len(m.migrations) == lastVersion {
301+
if len(m.migrations) <= lastVersion {
302302
logging.FromContext(ctx).Debug("All migrations done!")
303303
// no more migration to play
304304
return ErrAlreadyUpToDate

0 commit comments

Comments
 (0)