这是迁移文件迁移列 - Rails的
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.string :name
t.string :email
t.text :body
t.boolean :spam, default: false
t.references :post, index: true, foreign_key: true
t.references :user, index: true, foreign_key: true
t.timestamps null: false
end
end
end
没有在Heroku因为某些原因产生的user_id列。在Heroku
Comment(id: integer, name: string, email: string, body: text, post_id: integer, created_at: datetime, updated_at: datetime)
我已经试过heroku restart
实际的表可能会更新架构或东西,但什么都没有。
在我的本地环境中,我可以看到并可以使用user_id列。