mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-04 19:15:30 +00:00
simply upgrade database
This commit is contained in:
parent
8c85119f5c
commit
d8bb62900d
@ -2,22 +2,12 @@
|
||||
set -Eeuo pipefail
|
||||
cd /opt/powerdns-admin
|
||||
|
||||
DB_MIGRATION_DIR='./migrations'
|
||||
|
||||
if [ ! -f ./config.py ]; then
|
||||
cat ./config_template.py ./docker/Production/config_docker.py > ./config.py
|
||||
fi
|
||||
|
||||
if [ "$1" == gunicorn ]; then
|
||||
if [ ! -d "${DB_MIGRATION_DIR}" ]; then
|
||||
flask db init --directory ${DB_MIGRATION_DIR}
|
||||
flask db migrate -m "Init DB" --directory ${DB_MIGRATION_DIR}
|
||||
flask db upgrade --directory ${DB_MIGRATION_DIR}
|
||||
./init_data.py
|
||||
else
|
||||
flask db migrate -m "Upgrade DB Schema" --directory ${DB_MIGRATION_DIR}
|
||||
flask db upgrade --directory ${DB_MIGRATION_DIR}
|
||||
fi
|
||||
flask db upgrade
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user