From 54e00e2a8f9d89600814acefe26e53efa2fce7f0 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 13 Aug 2022 10:12:04 -0500 Subject: [PATCH] Manually cherry pick 578eeb8 --- migrate/migrate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migrate/migrate.go b/migrate/migrate.go index bc2b368..568a4aa 100644 --- a/migrate/migrate.go +++ b/migrate/migrate.go @@ -129,11 +129,12 @@ func FindMigrations(fsys fs.FS) ([]string, error) { return nil, fmt.Errorf("Duplicate migration %d", n) } + // Set at specific index, so that paths are properly sorted paths = setAt(paths, 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) }