Merge pull request #449 from halkeye/run-db-migration-after-configs

Run migrations after config file is in place, so it can be properly generated
This commit is contained in:
Tulir Asokan
2020-04-06 10:19:54 +03:00
committed by GitHub
+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