Skip to content

Instantly share code, notes, and snippets.

@georgiybykov
Last active January 15, 2021 16:41
Show Gist options
  • Select an option

  • Save georgiybykov/b359f9638dd8ade496f80ab43eb15189 to your computer and use it in GitHub Desktop.

Select an option

Save georgiybykov/b359f9638dd8ade496f80ab43eb15189 to your computer and use it in GitHub Desktop.
How to reset PostgreSQL database on Heroku?

How to reset PostgreSQL database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (do not change the DATABASE)
  • Step 3: heroku run rails db:migrate
  • Step 4: heroku run rails db:seed

Note

If you have more than one remote repository, then append in the end of each command --remote [name_of_the_remote] like this:

heroku run rails db:migrate --remote staging (staging is an example of the remote)

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