sahana-eden/sahana/image.d/usr/local/bin/migrate

16 lines
632 B
Plaintext
Raw Normal View History

2022-03-06 10:59:23 +01:00
#!/bin/sh
# This is a compatible rewrite of https://github.com/sahana/eden_deploy/blob/master/roles/common/files/migrate specific for Alpine s6-based container
# Migrate database
cd /srv/web2py
sed -i 's/settings.base.migrate = False/settings.base.migrate = True/g' applications/eden/models/000_config.py
rm -rf applications/eden/compiled
sudo -u sahana -- ./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py
sed -i 's/settings.base.migrate = True/settings.base.migrate = False/g' applications/eden/models/000_config.py
# Restart uwsgi
if [ "$1" != "norestart" ]; then
s6-svc -t /etc/services.d/uwsgi
fi