aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-01-07 01:11:17 +1030
committerMatthew Draper <matthew@trebex.net>2016-01-07 01:11:17 +1030
commit998b85ffe8997bb4da23f8ff65d3f4bb59e90a7e (patch)
treecd75139cb9baf12e2be902f3c0896017349354e9 /activerecord/lib
parent4137d44b2282abb7a7e7763f0abdc2fc108065ba (diff)
parent76dc41abdb33f69c078818dd8142bdf47834baa5 (diff)
downloadrails-998b85ffe8997bb4da23f8ff65d3f4bb59e90a7e.tar.gz
rails-998b85ffe8997bb4da23f8ff65d3f4bb59e90a7e.tar.bz2
rails-998b85ffe8997bb4da23f8ff65d3f4bb59e90a7e.zip
Merge pull request #22941 from lsylvester/pg-remove-index-legacy
Fix remove_index for postgresql when running legacy migrations
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/migration/compatibility.rb5
1 files changed, 3 insertions, 2 deletions
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