Created
July 31, 2016 14:23
-
-
Save timrogers/02c42be72d38b9443c5b4407af05c1d5 to your computer and use it in GitHub Desktop.
herokuize, a script for seeding your local Rails environment from Heroku. Just specify $PG_USERNAME and $PG_DATABASE.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
heroku pg:backups capture | |
curl -o latest.dump `heroku pg:backups public-url` | |
bundle exec rake db:drop db:create | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $PG_USERNAME -d $PG_DATABASE latest.dump | |
rm latest.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment