]> 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-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 22 Mar 2024 13:53:57 +0000 (13:53 +0000)
commit63168983aaa6749d54ab5be07d7c911caacc2f23
treee5894c98f5ef5520b7a2827e917f5ea1f2c08871
parent988986bdc9c25ef1f60298af5e544684b230d80c
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.
contrib/ast-db-manage/env.py