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.
This commit is contained in:
Boris Bobrov 2017-03-04 10:58:48 +03:00
parent 2d0870e061
commit 3bad5310f6

View File

@ -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()