mirror of
https://github.com/navidrome/navidrome.git
synced 2025-07-14 07:31:28 +03:00
* Simplify folder hash migration * fix hashing lint * refactor Signed-off-by: Deluan <deluan@navidrome.org> * Update scanner/folder_entry.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: Deluan <deluan@navidrome.org> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
22 lines
424 B
Go
22 lines
424 B
Go
package migrations
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
|
|
"github.com/pressly/goose/v3"
|
|
)
|
|
|
|
func init() {
|
|
goose.AddMigrationContext(upAddFolderHash, downAddFolderHash)
|
|
}
|
|
|
|
func upAddFolderHash(ctx context.Context, tx *sql.Tx) error {
|
|
_, err := tx.ExecContext(ctx, `alter table folder add column hash varchar default '' not null;`)
|
|
return err
|
|
}
|
|
|
|
func downAddFolderHash(ctx context.Context, tx *sql.Tx) error {
|
|
return nil
|
|
}
|