clearing rails app database on heroku production site
You can use heroku pg:reset DATABASE
command to reset the entire database. The command will simply drop and create the database.
You have to use heroku rake db:migrate
to create the tables then.
Alternatively you can use rake db:reset
command locally and then run heroku db:push
to update the production db.
heroku pg:reset DATABASE --confirm {app-name}
heroku run rake db:migrate
heroku run rake db:seed
Login on Heroku through terminal and then run one of following commands:
heroku rake db:reset
//or:
heroku run rake db:reset
The first one is an old one and the second is latest.
The 2013 way to do this is:
Enter heroku pg:reset DATABASE
in your console and then enter in your app name when prompted. This will drop the entire database -- tables, rows, columns, all of its data, everything.
Then, enter heroku run rake db:migrate
. This will create the same table, rows, and columns, but without any object data.