navidrome/db/migration/20221219140528_remove_cover...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
538 B
Go
Raw Normal View History

2022-12-19 20:11:43 +01:00
package migrations
import (
"database/sql"
2023-04-04 15:57:00 +02:00
"github.com/pressly/goose/v3"
2022-12-19 20:11:43 +01:00
)
func init() {
goose.AddMigration(upRemoveCoverArtId, downRemoveCoverArtId)
}
func upRemoveCoverArtId(tx *sql.Tx) error {
_, err := tx.Exec(`
alter table album drop column cover_art_id;
alter table album rename column cover_art_path to embed_art_path
`)
if err != nil {
return err
}
notice(tx, "A full rescan needs to be performed to import all album images")
return forceFullRescan(tx)
}
func downRemoveCoverArtId(tx *sql.Tx) error {
return nil
}