Skip to content

Instantly share code, notes, and snippets.

View masroorhussainv's full-sized avatar
🏴

Masroor Hussain masroorhussainv

🏴
View GitHub Profile
@masroorhussainv
masroorhussainv / heroku_pg_db_reset.md
Last active May 12, 2022 14:36 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart -a app_name
  • Step 2: heroku pg:reset DATABASE -a app_name (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate -a app_name
  • Step 4: heroku run rake db:seed -a app_name (if you have seed)

One liner

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