diff options
author | CaselIT <cfederico87@gmail.com> | 2023-01-11 21:17:33 +0100 |
---|---|---|
committer | CaselIT <cfederico87@gmail.com> | 2023-01-11 21:17:58 +0100 |
commit | a304dd12c0242a8e959de6b10272f39052282019 (patch) | |
tree | 11ae6ecd6238bb832811f3d2e18155646ef04633 /docs | |
parent | eb01c5407d0eb164944973be0189d950d8ea46af (diff) | |
download | alembic-a304dd12c0242a8e959de6b10272f39052282019.tar.gz |
Add commit to cookbook example
A commit is now required to end the transaction before start
executing the migration
Fixes: #1150
Change-Id: I704db15155454dafed9d15f768b97f8e2ebfff81
Diffstat (limited to 'docs')
-rw-r--r-- | docs/build/cookbook.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/build/cookbook.rst b/docs/build/cookbook.rst index 5b12c6b..8ac5bfc 100644 --- a/docs/build/cookbook.rst +++ b/docs/build/cookbook.rst @@ -845,6 +845,8 @@ schema or another. # PostgreSQL will emit all CREATE / ALTER / DROP statements # in terms of this schema by default connection.execute(text('set search_path to "%s"' % current_tenant)) + # in SQLAlchemy v2+ the search path change needs to be committed + connection.commit() # make use of non-supported SQLAlchemy attribute to ensure # the dialect reflects tables in terms of the current tenant name |