Skip to content

Instantly share code, notes, and snippets.

@ankane
Last active December 12, 2015 02:38
Show Gist options
  • Save ankane/4700495 to your computer and use it in GitHub Desktop.
Save ankane/4700495 to your computer and use it in GitHub Desktop.
#!/bin/bash
# From http://chrismccord.com/blog/2013/01/09/better-heroku-db-push-and-db-pull/
#
# Postgres equivalent to heroku db:push.
# Pushes local database up to heroku application database.
#
# Requirements: psql --version >= 9.2.2
#
# Usage:
#
# $ heroku_pg_push [appname] [local database name]
#
heroku pg:reset DATABASE_URL -a $1
pg_dump -xO $2 | psql `heroku config:get DATABASE_URL -a $1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment