4

I have a rails app running on the Elastic Beanstalk service.

When I deploy my app, some pages didn't work. I think the problem is that after I delete a model and create a new model with the same name but different schema, the database didn't reset.

On local, I can run rake db:drop, rake db:create, rake db:migrate to reset the database. However, how to reset the database on EB?

Stephen
  • 3,822
  • 2
  • 25
  • 45

2 Answers2

3

to run it manually, you can simply eb ssh your environment and issue the rake commands. Alternatively if you don't need that db, simply recreate the environment from the beanstalk web console, which will recreate the db.

Tal
  • 7,827
  • 6
  • 38
  • 61
  • 1
    Thanks for your answer. But how to run the `rake` commands on ssh. It says `No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)`, I cannot find the app directory. – Stephen Jan 03 '16 at 14:12
  • 2
    check out `/var/app/current`. make sure you're root (`sudo su -`) – Tal Jan 03 '16 at 15:15
0

i think you have to delete also structure.rb file manual from your rails application and let it create again by using rake db:migrate

mfathy00
  • 1,601
  • 1
  • 13
  • 28