From a304dd12c0242a8e959de6b10272f39052282019 Mon Sep 17 00:00:00 2001 From: CaselIT Date: Wed, 11 Jan 2023 21:17:33 +0100 Subject: [PATCH] Add commit to cookbook example A commit is now required to end the transaction before start executing the migration Fixes: #1150 Change-Id: I704db15155454dafed9d15f768b97f8e2ebfff81 --- docs/build/cookbook.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/build/cookbook.rst b/docs/build/cookbook.rst index 5b12c6b0..8ac5bfc0 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 -- 2.47.2