Heroku: How to push seeds.rb to existing rails app?

前端 未结 4 1130
北海茫月
北海茫月 2020-12-29 07:20

I store all my app\'s data in seeds.rb locally. However, after I pushing everything to Heroku, the app works well, but without any data. I do not want to re-input the mass d

4条回答
  •  隐瞒了意图╮
    2020-12-29 08:09

    If you have changed migrations then first you need to do is run migration

    heroku run rake db:migrate
    

    then

    heroku run rake db:seed
    

    If you don't have any data in database the I would suggest following is, But caution it will remove all current data from heroku database.

    heroku run rake db:setup
    

    Hope this helps you

提交回复
热议问题