Skip to content

Commit ae26b21

Browse files
authored
Merge pull request #172 from jufemaiz/bugfix/171/file-does-not-exist
migrate.go to resolve #171
2 parents 531fb8a + 011dc47 commit ae26b21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

migrate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ func findMigrations(dir http.FileSystem) ([]*Migration, error) {
275275
}
276276

277277
func migrationFromFile(dir http.FileSystem, info os.FileInfo) (*Migration, error) {
278-
file, err := dir.Open(info.Name())
278+
path := fmt.Sprintf("/%s", strings.TrimPrefix(info.Name(), "/"))
279+
file, err := dir.Open(path)
279280
if err != nil {
280281
return nil, fmt.Errorf("Error while opening %s: %s", info.Name(), err)
281282
}

0 commit comments

Comments
 (0)