In my migrations, I have a lot of repetition for separate indices on the same table:
add_index :table, :foo
add_index :table, :bar
This patch makes this possible:
add_index :table, :foo, :bar
Note that this is different from indexes with multiple columns:
add_index :table, [:foo, :bar]
This patch makes these possible, also:
add_index :table, :foo, :bar, :type => 'FULLTEXT'
# CREATE FULLTEXT INDEX ...
remove_index :table, :foo, :bar
add_index :table, :name => 'foo', :column_sql => 'foo DESC, bar ASC'
# CREATE INDEX foo ON table (foo DESC, bar ASC)
The patch also does a nice refactoring of remove_index logic in adapters and it fixes incorrect documentation about index naming conventions.