]> 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:47:40 +0000 (13:47 +0000)
commitdd0d4efc7c38455858a4f5dd6a1b58de5517a50a
treecd376088af7de74e43612c3c9d67dfeb40f993da
parent3705d9e16ee53fb3f4006a12d8b6be8644746f0d
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 9bdbcf0aadbffb98d9a994b118b572d084e87d4f)
contrib/ast-db-manage/env.py