generate-fixtures: Be more robust to databases being missing

(imported from commit f42d673c433b8d3df4af79159831e57f5db1ee1c)
This commit is contained in:
Zev Benjamin 2014-01-30 17:40:07 -05:00
parent 2b1a5ae141
commit 17826dba42
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ if [ $template_grep_error_code == "0" ]; then
cmp -s zerver/fixtures/available-migrations zerver/fixtures/migration-status && cmp -s zerver/fixtures/available-migrations zerver/fixtures/migration-status &&
[ "$1" != "--force" ]; then [ "$1" != "--force" ]; then
psql -h localhost postgres zulip_test << EOF psql -h localhost postgres zulip_test << EOF
DROP DATABASE zulip_test; DROP DATABASE IF EXISTS zulip_test;
CREATE DATABASE zulip_test TEMPLATE zulip_test_template; CREATE DATABASE zulip_test TEMPLATE zulip_test_template;
EOF EOF
exit 0 exit 0
@ -37,6 +37,6 @@ python manage.py dumpdata --settings=zproject.test_settings \
# create pristine template database, for fast fixture restoration after tests are run. # create pristine template database, for fast fixture restoration after tests are run.
psql -h localhost postgres zulip_test << EOF psql -h localhost postgres zulip_test << EOF
DROP DATABASE zulip_test_template; DROP DATABASE IF EXISTS zulip_test_template;
CREATE DATABASE zulip_test_template TEMPLATE zulip_test; CREATE DATABASE zulip_test_template TEMPLATE zulip_test;
EOF EOF