aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPaulo Fidalgo <paulo.fidalgo.pt@gmail.com>2018-09-06 17:58:44 +0100
committerPaulo Fidalgo <paulo.fidalgo.pt@gmail.com>2018-09-06 20:07:20 +0100
commitb54e5706e76396cf65760b5b41a61bf0a836786e (patch)
tree10ddbbd9eb9cbf5069fc45f70892ead179fc3ede /activerecord
parentba38e13c8272f1d10cf2381d6e5d3021020c6f62 (diff)
downloadrails-b54e5706e76396cf65760b5b41a61bf0a836786e.tar.gz
rails-b54e5706e76396cf65760b5b41a61bf0a836786e.tar.bz2
rails-b54e5706e76396cf65760b5b41a61bf0a836786e.zip
[ci skip] Improve remove_column documentation
Since when we remove one column it will also remove the associated indexes, we must ensure this behaviour is properly documented. In this commit we add a line to the documentation mentioning this behaviour.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 199674f531..9d9a8626de 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -599,6 +599,7 @@ module ActiveRecord
# The +type+ and +options+ parameters will be ignored if present. It can be helpful
# to provide these in a migration's +change+ method so it can be reverted.
# In that case, +type+ and +options+ will be used by #add_column.
+ # Indexes on the column are automatically removed.
def remove_column(table_name, column_name, type = nil, options = {})
execute "ALTER TABLE #{quote_table_name(table_name)} #{remove_column_for_alter(table_name, column_name, type, options)}"
end