Fix migration package name mismatch

This commit is contained in:
Deluan 2024-05-08 19:54:48 -04:00
parent eb93136b3f
commit a0290587b9
76 changed files with 6 additions and 6 deletions

View file

@ -61,12 +61,12 @@ snapshots: ##@Development Update (GoLang) Snapshot tests
migration-sql: ##@Development Create an empty SQL migration file migration-sql: ##@Development Create an empty SQL migration file
@if [ -z "${name}" ]; then echo "Usage: make migration-sql name=name_of_migration_file"; exit 1; fi @if [ -z "${name}" ]; then echo "Usage: make migration-sql name=name_of_migration_file"; exit 1; fi
go run github.com/pressly/goose/v3/cmd/goose@latest -dir db/migration create ${name} sql go run github.com/pressly/goose/v3/cmd/goose@latest -dir db/migrations create ${name} sql
.PHONY: migration .PHONY: migration
migration-go: ##@Development Create an empty Go migration file migration-go: ##@Development Create an empty Go migration file
@if [ -z "${name}" ]; then echo "Usage: make migration-go name=name_of_migration_file"; exit 1; fi @if [ -z "${name}" ]; then echo "Usage: make migration-go name=name_of_migration_file"; exit 1; fi
go run github.com/pressly/goose/v3/cmd/goose@latest -dir db/migration create ${name} go run github.com/pressly/goose/v3/cmd/goose@latest -dir db/migrations create ${name}
.PHONY: migration .PHONY: migration
setup-dev: setup setup-dev: setup

View file

@ -7,7 +7,7 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"github.com/navidrome/navidrome/conf" "github.com/navidrome/navidrome/conf"
_ "github.com/navidrome/navidrome/db/migration" _ "github.com/navidrome/navidrome/db/migrations"
"github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/utils/singleton" "github.com/navidrome/navidrome/utils/singleton"
"github.com/pressly/goose/v3" "github.com/pressly/goose/v3"
@ -18,10 +18,10 @@ var (
Path string Path string
) )
//go:embed migration/*.sql //go:embed migrations/*.sql
var embedMigrations embed.FS var embedMigrations embed.FS
const migrationsFolder = "migration" const migrationsFolder = "migrations"
func Db() *sql.DB { func Db() *sql.DB {
return singleton.GetInstance(func() *sql.DB { return singleton.GetInstance(func() *sql.DB {

View file

@ -1 +1 @@
-s -r "(\.go$$|\.cpp$$|\.h$$|navidrome.toml|resources|token_received.html)" -R "(^ui|^data|^db/migration)" -- go run -race -tags netgo . -s -r "(\.go$$|\.cpp$$|\.h$$|navidrome.toml|resources|token_received.html)" -R "(^ui|^data|^db/migrations)" -- go run -race -tags netgo .