This creates an index with the name position_and_produkt_id_uniq:
add_index :bilder, [:produkt_id, :position], :unique => true, :name =>
:position_and_produkt_id_uniq
This should remove the same one:
remove_index :bilder, :position_and_produkt_id_uniq
Sadly I get the following error:
Mysql::Error: Can’t DROP ‘bilder_position_and_produkt_id_uniq_index’;
check that column/key exists: DROP INDEX bilder_position_and_produkt_id_uniq_index ON bilder
Why does Rails append the suffix _index to the given name?? And how can
I prevent it?
This creates an index with the name position_and_produkt_id_uniq:
add_index :bilder, …:name => :position_and_produkt_id_uniq
This should remove the same one:
remove_index :bilder, :position_and_produkt_id_uniq