Run migrations after config file is in place, so it can be properly generated

This commit is contained in:
Gavin Mogan
2020-04-05 23:50:41 -07:00
parent a53b0e9837
commit 7726925771
+3 -2
View File
@@ -13,8 +13,6 @@ sed -i "s#sqlite:///mautrix-telegram.db#sqlite:////data/mautrix-telegram.db#" /d
if [ -f /data/mx-state.json ]; then
ln -s /data/mx-state.json
fi
# Check that database is in the right state
alembic -x config=/data/config.yaml upgrade head
if [ ! -f /data/config.yaml ]; then
cp mautrix_telegram/example-config.yaml /data/config.yaml
@@ -35,5 +33,8 @@ if [ ! -f /data/registration.yaml ]; then
exit
fi
# Check that database is in the right state
alembic -x config=/data/config.yaml upgrade head
fixperms
exec su-exec $UID:$GID python3 -m mautrix_telegram -c /data/config.yaml