提交 475318d3 编写于 作者: R Ryuta Kamizono

Use `index_algorith(...)` instead of `index_algorithms.fetch(...)`

上级 1f1ab896
......@@ -474,14 +474,7 @@ def remove_index(table_name, column_name = nil, options = {}) # :nodoc:
index_to_remove = PostgreSQL::Name.new(table.schema, index_name_for_remove(table.to_s, column_name, options))
algorithm =
if options.key?(:algorithm)
index_algorithms.fetch(options[:algorithm]) do
raise ArgumentError.new("Algorithm must be one of the following: #{index_algorithms.keys.map(&:inspect).join(', ')}")
end
end
execute "DROP INDEX #{algorithm} #{quote_table_name(index_to_remove)}"
execute "DROP INDEX #{index_algorithm(options[:algorithm])} #{quote_table_name(index_to_remove)}"
end
# Renames an index of a table. Raises error if length of new
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册