-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I embed my sql files with the new go:embed:
//go:embed *.sql
var EmbedFs embed.FS
var HttpFs = http.FS(EmbedFs)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 {Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels