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:
adam jones 2025-09-02 14:51:23 +01:00 • committed by GitHub
commit 6f0d43320a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}