fix: use path.Join instead of filepath.Join for embedded migrations (#338)
Fixes Windows compatibility issue where filepath.Join uses backslashes but embed.FS always expects forward slashes for embedded paths. Fixes #337 Also see https://github.com/golang/go/issues/44305 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: adam jones <domdomegg@users.noreply.github.com>
This commit is contained in:
parent
d3cde5d3aa
commit
6f0d43320a
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -96,7 +96,7 @@ func (m *Migrator) loadMigrations() ([]Migration, error) {
|
|||
}
|
||||
|
||||
// Read the migration SQL
|
||||
content, err := migrationFiles.ReadFile(filepath.Join("migrations", name))
|
||||
content, err := migrationFiles.ReadFile(path.Join("migrations", name))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read migration file %s: %w", name, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue