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:
parent
2d0870e061
commit
3bad5310f6
@ -48,7 +48,7 @@ def run_migrations_online():
|
|||||||
and associate a connection with the context.
|
and associate a connection with the context.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
connection = config.attributes["session"].get_bind()
|
connection = config.attributes["session"].connection()
|
||||||
context.configure(
|
context.configure(
|
||||||
connection=connection,
|
connection=connection,
|
||||||
target_metadata=target_metadata
|
target_metadata=target_metadata
|
||||||
@ -61,4 +61,3 @@ if context.is_offline_mode():
|
|||||||
run_migrations_offline()
|
run_migrations_offline()
|
||||||
else:
|
else:
|
||||||
run_migrations_online()
|
run_migrations_online()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user