#!/bin/bash -xe # Change to root directory of the checkout that we're running from cd "$(dirname "$0")/../.." python manage.py checkconfig python manage.py migrate --noinput python manage.py createcachetable third_party_api_results if ! python manage.py initialize_voyager_db; then set +x echo echo -e "\033[32mPopulating default database failed." echo "After you fix the problem, you will need to do the following before rerunning this:" echo " * supervisorctl stop all # to stop all services that might be accessing the database" echo " * scripts/setup/postgres-init-db # run as root to drop and re-create the database" echo -e "\033[0m" set -x fi supervisorctl restart all