fix: couldn't delete player snapshots - query timeout
This commit is contained in:
parent
3f6466ef0c
commit
37b39c447f
|
@ -0,0 +1,19 @@
|
|||
package migrations
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
func init() {
|
||||
migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
|
||||
// CREATE INDEX CONCURRENTLY IF NOT EXISTS player_snapshots_server_key_date_idx ON player_snapshots(server_key, date);
|
||||
_, err := db.ExecContext(ctx, "CREATE INDEX CONCURRENTLY IF NOT EXISTS"+
|
||||
" player_snapshots_server_key_date_idx ON player_snapshots(server_key, date);")
|
||||
return err
|
||||
}, func(ctx context.Context, db *bun.DB) error {
|
||||
_, err := db.ExecContext(ctx, "DROP INDEX CONCURRENTLY IF EXISTS player_snapshots_server_key_date_idx;")
|
||||
return err
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user