So I upgraded to Rails 1.2.1 and off the bat did a
rake db:migrate VERSION=0
to start all fresh and clean.
Right away it failed in my first migration’s down() method, because it
couldnt find the index in remove_index().
I got into my MySQL DB and sure enough the indexes were there. Long
story short, I looked at:
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
And there is an obvious change in the way the method “index_name” works
to generate the index name to either add or remove depending on your
context.
In a nutshell:
Rails 1.1.6: remove_index :users, :email -> looks for an index named
“users_email_index”
Rails 1.2.1: remove_index :users, :email -> looks for an index named
“index_users_email”
So of course Rails 1.2.1 isnt going to find this index, because it was
created with Rails 1.1.6.
Now, this is one thing. But looking through the ActiveRecord CHANGELOG,
there is NO mention of this, much less a way to fix it without manually
going into all my migrations and specifying the name of the index by
hand (rather than having Rails try to auto-generate the index name).
Is there something I am missing here?