Created
November 4, 2015 15:01
-
-
Save graemeboyd/cc6f4a325283b8ef03d9 to your computer and use it in GitHub Desktop.
Dump Heroku database structure and schema
This file contains hidden or 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
# Sleep 5 tries to avoid Heroku truncating the output by terminating the connection before everything has transferred. | |
# Dump structure.sql as heroku_structure.sql | |
heroku run 'bundle exec rake db:structure:dump && cat db/structure.sql && sleep 5' --app app-name > db/heroku_structure.sql | |
# Dump schema.rb as heroku_schema.db | |
heroku run 'bundle exec rake db:schema:dump && cat db/schema.rb && sleep 5' --app app-name > db/heroku_schema.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment