Skip to content

Commit 6f73c9e

Browse files
authored
Use DropIndexAction when rolling back index creation (#891)
Related to #742
1 parent 2293fdd commit 6f73c9e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/migrations/op_create_index.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ func (o *OpCreateIndex) Rollback(ctx context.Context, l Logger, conn db.DB, s *s
8989
l.LogOperationRollback(o)
9090

9191
// drop the index concurrently
92-
_, err := conn.ExecContext(ctx, fmt.Sprintf("DROP INDEX CONCURRENTLY IF EXISTS %s",
93-
pq.QuoteIdentifier(o.Name)))
94-
95-
return err
92+
return NewDropIndexAction(conn, o.Name).Execute(ctx)
9693
}
9794

9895
func (o *OpCreateIndex) Validate(ctx context.Context, s *schema.Schema) error {

0 commit comments

Comments
 (0)