mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-04 04:11:14 +03:00
* Initial draft - UNTESTED * changes to Save() and Update() * apply col filter and limit nanoid * remove columns to not update
26 lines
495 B
Go
26 lines
495 B
Go
package migrations
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
"github.com/pressly/goose"
|
|
)
|
|
|
|
func init() {
|
|
goose.AddMigration(upUpdateShareFieldNames, downUpdateShareFieldNames)
|
|
}
|
|
|
|
func upUpdateShareFieldNames(tx *sql.Tx) error {
|
|
_, err := tx.Exec(`
|
|
alter table share rename column expires to expires_at;
|
|
alter table share rename column created to created_at;
|
|
alter table share rename column last_visited to last_visited_at;
|
|
`)
|
|
|
|
return err
|
|
}
|
|
|
|
func downUpdateShareFieldNames(tx *sql.Tx) error {
|
|
return nil
|
|
}
|