From 76dc41abdb33f69c078818dd8142bdf47834baa5 Mon Sep 17 00:00:00 2001 From: Lachlan Sylvester Date: Tue, 5 Jan 2016 15:40:34 +1100 Subject: fix remove_index for postgresql when running legacy migrations --- activerecord/lib/active_record/migration/compatibility.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb index 831bfa2df3..1b94573870 100644 --- a/activerecord/lib/active_record/migration/compatibility.rb +++ b/activerecord/lib/active_record/migration/compatibility.rb @@ -41,8 +41,9 @@ module ActiveRecord end def remove_index(table_name, options = {}) - index_name = index_name_for_remove(table_name, options) - execute "DROP INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)}" + options = { column: options } unless options.is_a?(Hash) + options[:name] = index_name_for_remove(table_name, options) + super(table_name, options) end private -- cgit v1.2.3