Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Copser/a09850cf092b90c3b3b66570ce0a2e79 to your computer and use it in GitHub Desktop.
Save Copser/a09850cf092b90c3b3b66570ce0a2e79 to your computer and use it in GitHub Desktop.
Reset database on Heroku running Phoenix app

Note: Don't do this on a production evniroment!

Get the heroku database name:

heroku pg:info

Name can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337.

Reset the database:

heroku pg:reset DATABASE_NAME

Run the migrations:

heroku run MIX_ENV=prod mix ecto.migrate

Insert the seed data:

heroku run MIX_ENV=prod mix run priv/repo/seeds.exs

Restart the dynos:

heroku restart

Enjoy!

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