navidrome/db/migrations/20241209172239_duplicate.go
laker-93 8aaba56f0d fix beets address and add is_duplicate field. (#2)
* fix beet address

* add is_duplicate to sql db. Set if the 'dup' tag of the media file is set.
2024-12-27 21:55:30 +00:00

26 lines
472 B
Go

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
}