Skip to content

Instantly share code, notes, and snippets.

@belachkar
Last active May 11, 2020 03:34
Show Gist options
  • Save belachkar/2b694f22dc27f14f9754f7cc9a1ac3f0 to your computer and use it in GitHub Desktop.
Save belachkar/2b694f22dc27f14f9754f7cc9a1ac3f0 to your computer and use it in GitHub Desktop.

Reseting PG Database on Heroku

  1. Restart: heroku restart
  2. Reset the DB: heroku pg:reset DATABASE (no need to change the DATABASE)
  3. Migration: It depends on the framework.
    • heroku run rake db:migrate Or,
    • heroku run flask db upgrade depending the framework

On one line:

heroku restart && heroku pg:reset DATABASE_URL --confirm CHANGE_ME_TO_APP_NAME_ON_HEROKU && heroku run rake db:migrate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment