aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration
diff options
context:
space:
mode:
authorMehmet Emin İNAÇ <mehmetemininac@gmail.com>2016-03-15 03:01:09 +0200
committerMehmet Emin INAC <mehmetemininac@gmail.com>2017-09-21 11:06:21 +0200
commit611f2b2911197946bd81d5d5fb017e7133d77d2f (patch)
treefed20351120f93bbd67fa858c8f181286af44cdf /activerecord/lib/active_record/migration
parent6c199967fc5c32155684b95628751eb1b5098e13 (diff)
downloadrails-611f2b2911197946bd81d5d5fb017e7133d77d2f.tar.gz
rails-611f2b2911197946bd81d5d5fb017e7133d77d2f.tar.bz2
rails-611f2b2911197946bd81d5d5fb017e7133d77d2f.zip
Use algorithm while removing index with db:rollback
Closes #24190
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index a3a5e0fa16..ac7d506fd1 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -161,8 +161,8 @@ module ActiveRecord
table, columns, options = *args
options ||= {}
- index_name = options[:name]
- options_hash = index_name ? { name: index_name } : { column: columns }
+ options_hash = options.slice(:name, :algorithm)
+ options_hash[:column] = columns if !options_hash[:name]
[:remove_index, [table, options_hash]]
end