Answer the question
In order to leave comments, you need to log in
How to migrate to Heroku?
class CreateMessages < ActiveRecord::Migration[5.0]
def change
create_table :messages do |t|
t.string :message
t.references :room, foreign_key: true
t.references :user, foreign_key: true
t.timestamps
end
end
end
Answer the question
In order to leave comments, you need to log in
Set the column manually, something like this:t.integer :room_id, index:true
Make sure the rooms creation migration happens before this one.
After that, due to the fact that the database was migrated with a commented line, you need to roll back:heroku run rake db:rollback
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question