Files
zulip/tools/do-destroy-rebuild-database
Luke Faraone 81a2a20bbf Disable sync_api_key if no zuliprc
(imported from commit f9e7f924c00230137ca45c204158b709cd311ebb)
2015-08-16 16:45:15 -07:00

18 lines
428 B
Bash
Executable File

#!/bin/sh -xe
psql -h localhost postgres zulip <<EOF
DROP DATABASE IF EXISTS zulip;
CREATE DATABASE zulip TEMPLATE zulip_base;
EOF
python manage.py syncdb --noinput
python manage.py migrate
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