From: Boris Bobrov Date: Sat, 4 Mar 2017 07:58:48 +0000 (+0300) Subject: Pass connection to EnvironmentContext.configure X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4465521ad5ce99a9bd3e3e2fa68c7bb48f6a12c3;p=mediagoblin.git 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) --- 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() -