Fix a bug

This commit is contained in:
Neil Alexander 2022-10-18 10:49:38 +01:00
parent e8b52ff95d
commit 8daddef611
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -98,7 +98,7 @@ func DownRenameTables(ctx context.Context, tx *sql.Tx) error {
return err
}
query = strings.Replace(query, new, old, 1)
if _, err := tx.ExecContext(ctx, "DROP INDEX %s;", new); err != nil {
if _, err := tx.ExecContext(ctx, fmt.Sprintf("DROP INDEX %s;", new)); err != nil {
return fmt.Errorf("drop index %q to %q error: %w", new, old, err)
}
if _, err := tx.ExecContext(ctx, query); err != nil {