From 37e9d26994cd3a7c27685f91ae38b345b5d2bbdd Mon Sep 17 00:00:00 2001 From: SarahSmall Date: Mon, 16 Feb 2026 14:40:48 +0000 Subject: [PATCH 1/2] Update alembic alias to work with Python 3.13 --- scripts/add-aliases.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/add-aliases.sh b/scripts/add-aliases.sh index 5cfbc96..5137ae8 100755 --- a/scripts/add-aliases.sh +++ b/scripts/add-aliases.sh @@ -165,7 +165,8 @@ function fullreset(){ function alembic(){ ex -e SQL_USE_ALEMBIC_USER=yes -e SQL_PASSWORD=superroot -e SQLALCHEMY_POOL_RECYCLE=3600 ${1} \ - bash -c 'cd /src && python3 manage.py db '"${@:2}"'' + bash -c '( cd /src 2>/dev/null && python3 manage.py db '"${@:2}"' ) || \ + ( cd /opt/app-root/src && /opt/app-root/venv/bin/flask db '"${@:2}"' )' } function devenv-help(){ From c56c6cf0b838a9c2e514d35abff731c6502bf3a9 Mon Sep 17 00:00:00 2001 From: SarahSmall Date: Tue, 17 Feb 2026 11:59:06 +0000 Subject: [PATCH 2/2] check the app's python version to determine the alembic command to use --- scripts/add-aliases.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/add-aliases.sh b/scripts/add-aliases.sh index 5137ae8..f713885 100755 --- a/scripts/add-aliases.sh +++ b/scripts/add-aliases.sh @@ -164,9 +164,11 @@ function fullreset(){ } function alembic(){ + # If Python 3.13, use flask command. Otherwise, use manage.py ex -e SQL_USE_ALEMBIC_USER=yes -e SQL_PASSWORD=superroot -e SQLALCHEMY_POOL_RECYCLE=3600 ${1} \ - bash -c '( cd /src 2>/dev/null && python3 manage.py db '"${@:2}"' ) || \ - ( cd /opt/app-root/src && /opt/app-root/venv/bin/flask db '"${@:2}"' )' + bash -c 'cd /opt/app-root/src && if [[ "$PYTHON_VERSION" == "3.13" ]]; + then /opt/app-root/venv/bin/flask db '"${@:2}"' + else python3 manage.py db '"${@:2}"'; fi' } function devenv-help(){