Skip to content

Instantly share code, notes, and snippets.

@Humoud
Created March 7, 2016 08:06
Show Gist options
  • Save Humoud/9419094c3a76b7d3e027 to your computer and use it in GitHub Desktop.
Save Humoud/9419094c3a76b7d3e027 to your computer and use it in GitHub Desktop.
A cheat sheet for dealing with PostgreSQL database on Heroku.

General Commands

To reset a database (The closest thing to dropping a DB):

heroku pg:reset DATABASE --confirm db-name

Pushing you local database with it's data:

heroku pg:push local-db-name heroku-db-name --app app-name

Rails Specific Commands

Runing migrations and seed script on the database

heroku run rake db:migrate

heroku run rake db:seed

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