diff --git a/scripts/setup/create-database b/scripts/setup/initialize-database similarity index 59% rename from scripts/setup/create-database rename to scripts/setup/initialize-database index 17c7d6f1a0..bd6ec0dfb0 100755 --- a/scripts/setup/create-database +++ b/scripts/setup/initialize-database @@ -1,8 +1,15 @@ -#!/bin/sh -xe +#!/bin/bash -xe + +# Change to root directory of the checkout that we're running from +cd $(dirname $0)/../.. echo "DROP SCHEMA zulip CASCADE; CREATE SCHEMA zulip;" | python manage.py dbshell +python manage.py checkconfig + python manage.py syncdb --noinput python manage.py migrate python manage.py createcachetable third_party_api_results python manage.py initialize_enterprise_db + +supervisorctl restart all diff --git a/scripts/setup/install b/scripts/setup/install index 1fffeed891..27f20a9f31 100755 --- a/scripts/setup/install +++ b/scripts/setup/install @@ -43,16 +43,19 @@ ln -nsf /etc/zulip/settings.py /root/zulip/zproject/local_settings.py deploy_path=$($(dirname $(dirname $0))/unpack-zulip "$tarball") ln -nsf "$deploy_path" /home/zulip/deployments/current chown -R zulip:zulip /home/zulip/deployments /var/log/zulip +chown zulip:zulip /var/run/supervisor.sock cd /home/zulip/deployments/current -su zulip -c /home/zulip/deployments/current/scripts/setup/create-database - -chown zulip:zulip /var/run/supervisor.sock -supervisorctl restart all set +x cat <