2016-01-12 13:08:43 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
set -x
|
2012-10-30 21:11:37 +01:00
|
|
|
|
2015-09-28 19:45:35 +02:00
|
|
|
"$(dirname "$0")/../scripts/setup/terminate-psql-sessions" zulip zulip zulip_base
|
|
|
|
|
2019-04-02 01:00:57 +02:00
|
|
|
psql -v ON_ERROR_STOP=1 -e -h localhost postgres zulip <<EOF
|
2014-01-30 23:40:37 +01:00
|
|
|
DROP DATABASE IF EXISTS zulip;
|
|
|
|
CREATE DATABASE zulip TEMPLATE zulip_base;
|
|
|
|
EOF
|
2012-10-30 21:11:37 +01:00
|
|
|
|
2015-09-28 19:57:40 +02:00
|
|
|
sh "$(dirname "$0")/../scripts/setup/flush-memcached"
|
|
|
|
|
2017-06-05 07:47:03 +02:00
|
|
|
./manage.py purge_queue --all
|
2016-11-22 01:44:16 +01:00
|
|
|
./manage.py migrate --noinput
|
2017-10-18 04:23:06 +02:00
|
|
|
./manage.py get_migration_status --settings=zproject.settings --output="migration_status_dev"
|
2016-11-22 01:44:16 +01:00
|
|
|
./manage.py createcachetable third_party_api_results
|
|
|
|
./manage.py populate_db -n100 --threads=1
|
2013-08-07 17:36:46 +02:00
|
|
|
# Ensure that the local user's API key is synced from ~/.zuliprc
|
2015-06-10 20:28:02 +02:00
|
|
|
|
|
|
|
if [ -e ~/.zuliprc ]; then
|
2016-11-22 01:44:16 +01:00
|
|
|
./manage.py sync_api_key
|
2015-06-10 20:28:02 +02:00
|
|
|
fi
|