mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-08 14:21:09 +03:00
fixes after rebasing with upstream/master (#3)
This commit is contained in:
parent
8aaba56f0d
commit
b3ded07500
@ -1,25 +0,0 @@
|
|||||||
package migrations
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"database/sql"
|
|
||||||
"github.com/pressly/goose/v3"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
goose.AddMigrationContext(upDuplicate, downDuplicate)
|
|
||||||
}
|
|
||||||
|
|
||||||
func upDuplicate(ctx context.Context, tx *sql.Tx) error {
|
|
||||||
_, err := tx.Exec(`
|
|
||||||
alter table media_file
|
|
||||||
add is_duplicate bool not null default false;
|
|
||||||
|
|
||||||
`)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func downDuplicate(ctx context.Context, tx *sql.Tx) error {
|
|
||||||
// This code is executed when the migration is rolled back.
|
|
||||||
return nil
|
|
||||||
}
|
|
25
db/migrations/20241227222849_duplicate.go
Normal file
25
db/migrations/20241227222849_duplicate.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"database/sql"
|
||||||
|
"github.com/pressly/goose/v3"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
goose.AddMigrationContext(upDuplicate, downDuplicate)
|
||||||
|
}
|
||||||
|
|
||||||
|
func upDuplicate(ctx context.Context, tx *sql.Tx) error {
|
||||||
|
_, err := tx.Exec(`
|
||||||
|
alter table media_file
|
||||||
|
add is_duplicate bool not null default false;
|
||||||
|
|
||||||
|
`)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func downDuplicate(ctx context.Context, tx *sql.Tx) error {
|
||||||
|
// This code is executed when the migration is rolled back.
|
||||||
|
return nil
|
||||||
|
}
|
@ -158,7 +158,6 @@ func (api *Router) routes() http.Handler {
|
|||||||
h(r, "getLyricsBySongId", api.GetLyricsBySongId)
|
h(r, "getLyricsBySongId", api.GetLyricsBySongId)
|
||||||
hr(r, "stream", api.Stream)
|
hr(r, "stream", api.Stream)
|
||||||
hr(r, "download", api.Download)
|
hr(r, "download", api.Download)
|
||||||
hr(r, "delete", api.Delete)
|
|
||||||
})
|
})
|
||||||
r.Group(func(r chi.Router) {
|
r.Group(func(r chi.Router) {
|
||||||
// configure request throttling
|
// configure request throttling
|
||||||
|
Loading…
x
Reference in New Issue
Block a user