我刚使用此命令将我的表格客户端重命名为人员:
class RenameClientsToPeople < ActiveRecord::Migration
def change
rename_table :clients, :people
end
end
然后我仔细地将所有实例,文件名和外键(感谢Veraticus)从客户端重命名为 person ,从客户端重命名为人的。但由于某种原因,我仍然会遇到这样的错误:
SQLite3::SQLException: no such column: people.person_id: SELECT COUNT(*) FROM "projects" INNER JOIN "people" ON "projects"."person_id" = "people"."person_id" WHERE "people"."user_id" = 1
为什么赢得Rails识别新的主键?