在Rails 2中,删除带有Rails迁移的列还会更改/删除与列关联的索引吗?如果没有,而且您还必须手动更改/删除每个索引,那么它是否应该自动化?
谢谢(来自Rails新手)
在我的schema.rb中,我有以下行:
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
Run Code Online (Sandbox Code Playgroud)
当我\di在psql中运行时,我得到:
Schema | Name | Type | Owner | Table
--------+--------------------------------------------------------------+-------+-------+-----------------------
public | index_users_on_email | index | alex | users
Run Code Online (Sandbox Code Playgroud)
但是,如果我在迁移中包含以下内容之一:
我收到以下错误:
rake aborted!
An error has occurred, this and all later migrations canceled:
Index name 'index_users_on_email' on table 'users' does not exist
Run Code Online (Sandbox Code Playgroud)
我也发现了这个问题.那么任何想法?
ruby migration ruby-on-rails database-indexes rails-postgresql