Skip to content

Instantly share code, notes, and snippets.

@JulienSansot
Created June 16, 2017 16:22
Show Gist options
  • Save JulienSansot/1adf39ffa15ae7a125d02e86ede04b6f to your computer and use it in GitHub Desktop.
Save JulienSansot/1adf39ffa15ae7a125d02e86ede04b6f to your computer and use it in GitHub Desktop.
heroku postdeploy script to copy PG database
{
"scripts": {
"postdeploy": "pg_dump -Fc $DATABASE_URL_TO_COPY | pg_restore --clean --no-owner -n public -d $DATABASE_URL && bundle exec rails db:migrate"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment