quintodrome/db/migrations/20221219112733_add_album_image_paths.go

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

28 lines
541 B
Go
Raw Permalink Normal View History

package migrations
import (
2023-11-27 10:46:44 -09:00
"context"
"database/sql"
2023-04-04 05:57:00 -08:00
"github.com/pressly/goose/v3"
)
func init() {
2023-11-27 10:46:44 -09:00
goose.AddMigrationContext(upAddAlbumImagePaths, downAddAlbumImagePaths)
}
2023-11-27 10:46:44 -09:00
func upAddAlbumImagePaths(_ context.Context, 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)
}
2023-11-27 10:46:44 -09:00
func downAddAlbumImagePaths(_ context.Context, tx *sql.Tx) error {
return nil
}