You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then I call migrations.DefaultCollection.DiscoverSQLMigrationsFromFilesystem(migration.HttpFs, "/") to discover the sql files from the embedded filesystem. this works on linux but not on windows.
the following path makes it also work on windows as the underlying fs only uses forward slashed:
diff --git a/collection.go b/collection.go
index 29c8d99..7811b63 100644
--- a/collection.go+++ b/collection.go@@ -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 {
The text was updated successfully, but these errors were encountered:
… separator
when DiscoverSQLMigrations() is called, a 'os nativ' fs is assumed, so
convert the path to slash. when opening a file on such a fs, convert to
back from slash to native separator.
go-pg#107
I embed my sql files with the new go:embed:
then I call
migrations.DefaultCollection.DiscoverSQLMigrationsFromFilesystem(migration.HttpFs, "/")
to discover the sql files from the embedded filesystem. this works on linux but not on windows.the following path makes it also work on windows as the underlying fs only uses forward slashed:
The text was updated successfully, but these errors were encountered: