Add size to album details (#561)

* add size to album details

for #534

* addressing review comments:

* create index album(size)
* remove unneeded Size field from refresh struct
* add whitespace to album details
* add size to album list view

* prettier
This commit is contained in:
Jay R. Wren
2020-10-12 11:10:07 -04:00
committed by GitHub
parent c60e56828b
commit fd6edf967f
6 changed files with 39 additions and 4 deletions
@@ -0,0 +1,30 @@
package migration
import (
"database/sql"
"github.com/pressly/goose"
)
func init() {
goose.AddMigration(Up20201010162350, Down20201010162350)
}
func Up20201010162350(tx *sql.Tx) error {
_, err := tx.Exec(`
alter table album
add size integer default 0 not null;
create index if not exists album_size
on album(size);
`)
if err != nil {
return err
}
notice(tx, "A full rescan will be performed to calculate album sizes.")
return forceFullRescan(tx)
}
func Down20201010162350(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}