Skip to content

Commit 6f0d433

Browse files
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 golang/go#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 <[email protected]>
1 parent d3cde5d commit 6f0d433

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/database/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"errors"
77
"fmt"
88
"log"
9-
"path/filepath"
9+
"path"
1010
"sort"
1111
"strconv"
1212
"strings"
@@ -96,7 +96,7 @@ func (m *Migrator) loadMigrations() ([]Migration, error) {
9696
}
9797

9898
// Read the migration SQL
99-
content, err := migrationFiles.ReadFile(filepath.Join("migrations", name))
99+
content, err := migrationFiles.ReadFile(path.Join("migrations", name))
100100
if err != nil {
101101
return nil, fmt.Errorf("failed to read migration file %s: %w", name, err)
102102
}

0 commit comments

Comments
 (0)