]> 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)
committerSean Bright <sean@seanbright.com>
Fri, 22 Mar 2024 13:53:50 +0000 (13:53 +0000)
commit9bdbcf0aadbffb98d9a994b118b572d084e87d4f
tree5854c4334989c3534aa270a8028efc7744695b39
parent85138813340c598b2b0fb115b112522bf720d49f
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