Created
January 31, 2014 22:10
-
-
Save mpampols/8744297 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
# This script deletes an entire Django database, calls syncdb, and imports data tables | |
# Drop all tables in cascade | |
psql tablename << EOF | |
DROP SCHEMA public CASCADE; | |
CREATE SCHEMA "public" AUTHORIZATION "postgres"; | |
EOF | |
# Syncdb | |
python manage.py syncdb --noinput | |
# Import dumps into database | |
psql tablename << EOF | |
\i ./folder/dump_file_1; | |
\i ./folder/dump_file_2; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment