]> git.ipfire.org Git - thirdparty/asterisk.git/commit
alembic: Fix compatibility with SQLAlchemy 2.0+.
authorSean Bright <sean@seanbright.com>
Wed, 20 Mar 2024 16:20:40 +0000 (12:20 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 9 May 2024 13:56:11 +0000 (13:56 +0000)
commit396cc55965253535311a96716a4649bd3db01489
tree49a753c05880a8dca55dad82c7af6dd59decf544
parent2680d5be35276b2ccb8a6fab743cd2f51bb73095
alembic: Fix compatibility with SQLAlchemy 2.0+.

SQLAlchemy 2.0 changed the way that commits/rollbacks are handled
causing the final `UPDATE` to our `alembic_version_<whatever>` tables
to be rolled back instead of committed.

We now use one connection to determine which
`alembic_version_<whatever>` table to use and another to run the
actual migrations. This prevents the erroneous rollback.

This change is compatible with both SQLAlchemy 1.4 and 2.0.

(cherry picked from commit 8715a700e28a5d8059732606b8f7d52bedd11bf6)
contrib/ast-db-manage/env.py