pvc/api-daemon/pvc-api-db-init

18 lines
444 B
Bash
Executable File

#!/bin/bash
# Initialize the PVC database and migrations for future upgrades
# Part of the Parallel Virtual Cluster (PVC) system
export PVC_CONFIG_FILE="/etc/pvc/pvcapid.yaml"
if [[ ! -f ${PVC_CONFIG_FILE} ]]; then
echo "Create a configuration file at ${PVC_CONFIG_FILE} before initializing the database."
exit 1
fi
pushd /usr/share/pvc
./pvcapid-manage.py db init
./pvcapid-manage.py db migrate
./pvcapid-manage.py db upgrade
popd