Fix migration package name mismatch

This commit is contained in:
Deluan
2024-05-08 19:54:48 -04:00
parent eb93136b3f
commit a0290587b9
76 changed files with 6 additions and 6 deletions
@@ -0,0 +1,30 @@
package migrations
import (
"context"
"database/sql"
"github.com/pressly/goose/v3"
)
func init() {
goose.AddMigrationContext(upAddIdToScrobbleBuffer, downAddIdToScrobbleBuffer)
}
func upAddIdToScrobbleBuffer(ctx context.Context, tx *sql.Tx) error {
_, err := tx.ExecContext(ctx, `
delete from scrobble_buffer where user_id <> '';
alter table scrobble_buffer add id varchar not null default '';
create unique index scrobble_buffer_id_ix
on scrobble_buffer (id);
`)
return err
}
func downAddIdToScrobbleBuffer(ctx context.Context, tx *sql.Tx) error {
_, err := tx.ExecContext(ctx, `
drop index scrobble_buffer_id_ix;
alter table scrobble_buffer drop id;
`)
return err
}