quintodrome/db/migration/20221219112733_add_album_image_paths.go

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

27 lines
485 B
Go
Raw Normal View History

package migrations
import (
"database/sql"
2023-04-04 05:57:00 -08:00
"github.com/pressly/goose/v3"
)
func init() {
goose.AddMigration(upAddAlbumImagePaths, downAddAlbumImagePaths)
}
func upAddAlbumImagePaths(tx *sql.Tx) error {
_, err := tx.Exec(`
alter table main.album add image_files varchar;
`)
if err != nil {
return err
}
notice(tx, "A full rescan needs to be performed to import all album images")
return forceFullRescan(tx)
}
func downAddAlbumImagePaths(tx *sql.Tx) error {
return nil
}