Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (c *Collection) DiscoverSQLMigrations(dir string) error {
return err
}

return c.DiscoverSQLMigrationsFromFilesystem(osfilesystem{}, dir)
return c.DiscoverSQLMigrationsFromFilesystem(osfilesystem{}, filepath.ToSlash(dir))
}

// DiscoverSQLMigrations scan the dir from the given filesystem for files with .sql extension
Expand Down Expand Up @@ -219,7 +219,7 @@ func (c *Collection) DiscoverSQLMigrationsFromFilesystem(fs http.FileSystem, dir
}

m := newMigration(version)
filePath := filepath.Join(dir, fileName)
filePath := path.Join(dir, fileName)

if strings.HasSuffix(fileName, ".up.sql") {
if m.Up != nil {
Expand Down Expand Up @@ -777,5 +777,5 @@ func init() {
type osfilesystem struct{}

func (osfilesystem) Open(name string) (http.File, error) {
return os.Open(name)
return os.Open(filepath.FromSlash(name))
}