lib/pghero/methods/suggested_indexes.rb in pghero-3.6.0 vs lib/pghero/methods/suggested_indexes.rb in pghero-3.6.1
- old
+ new
@@ -77,10 +77,12 @@
def autoindex(create: false)
suggested_indexes.each do |index|
p index
if create
- connection.execute("CREATE INDEX CONCURRENTLY ON #{quote_table_name(index[:table])} (#{index[:columns].map { |c| quote_column_name(c) }.join(",")})")
+ with_connection do |connection|
+ connection.execute("CREATE INDEX CONCURRENTLY ON #{quote_table_name(index[:table])} (#{index[:columns].map { |c| quote_column_name(c) }.join(",")})")
+ end
end
end
end
def best_index(statement)