Skip to content

Instantly share code, notes, and snippets.

@rinti
Created November 2, 2014 21:18
Show Gist options
  • Save rinti/c52ba822e0ee2a74aedf to your computer and use it in GitHub Desktop.
Save rinti/c52ba822e0ee2a74aedf to your computer and use it in GitHub Desktop.
Get latest database backup from Heroku, and add it to your development database. Assumes your database name is the same as the directory name.
#!/bin/bash
dropdb ${PWD##*/} && createdb ${PWD##*/} && heroku pgbackups:url | xargs curl > latest.dump && pg_restore -d ${PWD##*/} latest.dump --clean --no-acl --no-owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment