In my schema.rb I have the following line:
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
When I run \di
in psql I get:
Schema | Name | Type | Owner | Table
--------+--------------------------------------------------------------+-------+-------+-----------------------
public | index_users_on_email | index | alex | users
Yet, if I include in a migration one of these:
- remove_index :users, name: :index_users_on_email
- remove_index :users, column: :email
- remove_index :users, :email
- execute 'DROP INDEX index_users_on_email'
I get the following error:
rake aborted!
An error has occurred, this and all later migrations canceled:
Index name 'index_users_on_email' on table 'users' does not exist
I also found this issue. So any ideas?