這是遷移文件遷移列 - 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列。