From 4465521ad5ce99a9bd3e3e2fa68c7bb48f6a12c3 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Sat, 4 Mar 2017 10:58:48 +0300 Subject: [PATCH] Pass connection to EnvironmentContext.configure In https://bitbucket.org/zzzeek/alembic/issues/419/ we were suggested use connection instead of engine. This should fix an issue reported via ml. (cherry picked from commit 3bad5310f683f2512e5d184555aa0108fbd3ff4b) --- mediagoblin/db/migrations/env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mediagoblin/db/migrations/env.py b/mediagoblin/db/migrations/env.py index 43b7b247..a6d05cd1 100644 --- a/mediagoblin/db/migrations/env.py +++ b/mediagoblin/db/migrations/env.py @@ -48,7 +48,7 @@ def run_migrations_online(): and associate a connection with the context. """ - connection = config.attributes["session"].get_bind() + connection = config.attributes["session"].connection() context.configure( connection=connection, target_metadata=target_metadata @@ -61,4 +61,3 @@ if context.is_offline_mode(): run_migrations_offline() else: run_migrations_online() - -- 2.25.1