Heroku run rake db:migrate results in no change in the database, app restarted several times Heroku run rake db:migrate results in no change in the database, app restarted several times heroku heroku

Heroku run rake db:migrate results in no change in the database, app restarted several times


It doesn't look like you are pushing changes to Heroku. Steps should be as follows;

  1. Make changes to local code
  2. Run any migrations LOCALLY
  3. Add all changed files to Git git add .
  4. Commit all added files to git git commit -m "Adding features"
  5. Push the changes to Heroku git push heroku master - assuming you are using heroku as your remote name and you are working in the master branch
  6. If you have migrations run heroku run rake db:migrate to run the migrations ON HEROKU
  7. Following migrations do heroku restart

That should be all you need to get you working.


I had the same problem; I git added the migrations, git pushed them to the server, cap deployed them, and the database didn't change. Logged in to the server directly, ran rake db:migrate, and the command line seemed to run the migration, but nothing changed.

In my case, somehow rake db:migrate was using the wrong RAILS_ENV. I logged in to the server, and ran

rake db:migrate RAILS_ENV=production

This caused the database to create the new columns, and then all of the code that I had debugged in the test database started working on the server.


I just had same problem. After adding a column to my DB locally, I did heroku run rake db:migrate -app [my app name]. Running my code on production, I got ActiveRecord::UnknownAttributeError (unknown attribute '_____' for [table name].)

This solved my problem:

heroku restart --app [my app name]