Merge "Use alembic migrations to deploy Monasca DB"

This commit is contained in:
Zuul 2018-09-20 08:32:17 +00:00 committed by Gerrit Code Review
commit 4c72aedb76

View File

@ -5,15 +5,7 @@ SERVICE="monasca-api"
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty. # of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# Set the database name in the monasca database schema monasca_db upgrade
sed "s/USE \`mon\`;/USE \`${MONASCA_DATABASE_NAME}\`;/g" \
/monasca-api/devstack/files/schema/mon_mysql.sql > /tmp/mon_mysql.sql
# Load the schema
mysql --host=${MONASCA_DATABASE_ADDRESS} \
--port=${MONASCA_DATABASE_PORT} \
--user=${MONASCA_DATABASE_USER} \
--password=${MONASCA_DATABASE_PASSWORD} \
< /tmp/mon_mysql.sql
exit 0 exit 0
fi fi