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

前端 未结 4 666
不思量自难忘°
不思量自难忘° 2020-12-14 09:37

I have a problem with pushing my migrations to the production database.

The issue:

  1. I\'ve altered database schema by adding 1 column.
  2. I\'ve

4条回答
  •  攒了一身酷
    2020-12-14 10:02

    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.

提交回复
热议问题