This project is archived and is in readonly mode.

#5711 ✓committed
Tim Connor

remove_index silently fails when passed a symbol as the index name

Reported by Tim Connor | September 26th, 2010 @ 11:57 PM | in 3.0.2

When removing an index, if a symbol is used for the index name the removal silently fails.

remove_index :my_table, :name => 'my_index_name'

works but

remove_index :my_table, :name => :my_index_name

does not work. The index removal fails because SchemaStatements#index_name_exists? uses == without first calling to_s on the passed name, so it compares a string with a symbol.

The issue is compounded by the swallowing of the exception, however this has since been fixed by

I have attached a patch to fix the problem

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>