mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-07 22:01:08 +03:00
patch db (#6)
This commit is contained in:
parent
5b72954409
commit
0754555803
26
db/migrations/20241025301254_remove_duplicate.go
Normal file
26
db/migrations/20241025301254_remove_duplicate.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"database/sql"
|
||||||
|
"github.com/pressly/goose/v3"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
goose.AddMigrationContext(upRemoveDuplicate, downRemoveDuplicate)
|
||||||
|
}
|
||||||
|
|
||||||
|
func upRemoveDuplicate(ctx context.Context, tx *sql.Tx) error {
|
||||||
|
// This code is executed when the migration is applied.
|
||||||
|
_, err := tx.Exec(`
|
||||||
|
alter table media_file
|
||||||
|
drop column is_duplicate;
|
||||||
|
|
||||||
|
`)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func downRemoveDuplicate(ctx context.Context, tx *sql.Tx) error {
|
||||||
|
// This code is executed when the migration is rolled back.
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user