Skip to content

Commit

Permalink
Fix migration package name mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed May 8, 2024
1 parent eb93136 commit a029058
Show file tree
Hide file tree
Showing 76 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ snapshots: ##@Development Update (GoLang) Snapshot tests

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
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

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
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

setup-dev: setup
Expand Down
6 changes: 3 additions & 3 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

_ "github.com/mattn/go-sqlite3"
"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/utils/singleton"
"github.com/pressly/goose/v3"
Expand All @@ -18,10 +18,10 @@ var (
Path string
)

//go:embed migration/*.sql
//go:embed migrations/*.sql
var embedMigrations embed.FS

const migrationsFolder = "migration"
const migrationsFolder = "migrations"

func Db() *sql.DB {
return singleton.GetInstance(func() *sql.DB {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion reflex.conf
Original file line number Diff line number Diff line change
@@ -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 .

0 comments on commit a029058

Please sign in to comment.