navidrome/db/migrations/20250701010101_add_folder_hash.go
Deluan Quintão 0d74d36cec
feat(scanner): add folder hash for smarter quick scan change detection (#4220)
* 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>
2025-06-12 13:17:34 -04:00

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
}