zulip/tools/do-destroy-rebuild-database

19 lines
459 B
Plaintext
Raw Normal View History

#!/bin/sh -xe
psql -h localhost postgres zulip <<EOF
DROP DATABASE IF EXISTS zulip;
CREATE DATABASE zulip TEMPLATE zulip_base;
EOF
sh "$(dirname "$0")/../scripts/setup/flush-memcached"
python manage.py migrate --noinput
python manage.py createcachetable third_party_api_results
python manage.py populate_db -n100 --threads=1
# Ensure that the local user's API key is synced from ~/.zuliprc
if [ -e ~/.zuliprc ]; then
python manage.py sync_api_key
fi