Skip to content

Commit bdfc622

Browse files
Update remove_column docs for how indexes are changed
Different databases have different behaviour when it comes to dropping a column that is part of a composite indexes. For example, MySQL and OracleDB will simply remove the column from the index. However PostgresQL will remove any index that is using that column.
1 parent 8a419e8 commit bdfc622

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,8 @@ def remove_columns(table_name, *column_names, type: nil, **options)
656656
# The +type+ and +options+ parameters will be ignored if present. It can be helpful
657657
# to provide these in a migration's +change+ method so it can be reverted.
658658
# In that case, +type+ and +options+ will be used by #add_column.
659-
# Indexes on the column are automatically removed.
659+
# Depending on the database you're using, indexes using this column may be
660+
# automatically removed or modified to remove this column from the index.
660661
#
661662
# If the options provided include an +if_exists+ key, it will be used to check if the
662663
# column does not exist. This will silently ignore the migration rather than raising

0 commit comments

Comments
 (0)