我的user表中应该有一个ROLE_ID(在我的表尚未新增) 我的角色表已经使用默认的主ID:ID 我目前正在使用的外国人插件它看起来像... class AddForeignKeyToUserFromRole < ActiveRecord::Migration
def change
add_foreign_key(:users,:roles)
end
end
我不断收到此异常:"SQLite3::SQLException: no such column: books.user_id: SELECT "books".* FROM "books" WHERE ("books".user_id = 4)"。这听起来像书籍表中没有user_id。 因此,我刚刚安装了Foreigner插件,并在书籍迁移文件中添加了"t.integer :user_id, :nu