Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 818 Bytes

Heroku_Reset-database.md

File metadata and controls

39 lines (31 loc) · 818 Bytes

How to reset PG Database on Heroku?

Step 1:

heroku restart

Step 2:

heroku pg:reset DATABASE
# no need to change DATABASE

Step 3:

heroku run rake db:migrate

Step 4:

# if you have seed
heroku run rake db:seed

One liner

heroku restart; heroku pg:reset DATABASE —confirm APP-NAME; heroku run rake db:migrate

Heroku doesn’t allow users from using rake db:reset, rake db:drop & rake db:create command. They only allow heroku pg:reset and rake db:migrate commands.

More info: https://devcenter.heroku.com/articles/rake

If you have more than 1 remote, append—remote [your_remote_name] like this:

heroku run rake db:migrate —remote dev
# dev is example remote here