patch db (#6)

This commit is contained in:
laker-93 2025-04-17 16:26:45 +01:00 committed by GitHub
parent 5b72954409
commit 0754555803
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View 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
}