Skip to content

Commit

Permalink
Add comment and simplify expression
Browse files Browse the repository at this point in the history
  • Loading branch information
rafabulsing committed Aug 12, 2022
1 parent 1932f36 commit 578eeb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ func FindMigrationsEx(path string, fs MigratorFS) ([]string, error) {
return nil, fmt.Errorf("Duplicate migration %d", n)
}

// Set at specific index, so that paths are properly sorted
paths = setAt(paths, filepath.Join(path, fi.Name()), n-1)
foundMigrations[n-1] = true
}

for i, _ := range paths {
for i := range paths {
if !foundMigrations[i] {
return nil, fmt.Errorf("Missing migration %d", i+1)
}
Expand Down

0 comments on commit 578eeb8

Please sign in to comment.