diff options
Diffstat (limited to 'alembic')
-rw-r--r-- | alembic/templates/generic/env.py | 2 | ||||
-rw-r--r-- | alembic/templates/multidb/env.py | 3 | ||||
-rw-r--r-- | alembic/templates/pylons/env.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/alembic/templates/generic/env.py b/alembic/templates/generic/env.py index f72400b..712b616 100644 --- a/alembic/templates/generic/env.py +++ b/alembic/templates/generic/env.py @@ -35,7 +35,7 @@ def run_migrations_offline(): """ url = config.get_main_option("sqlalchemy.url") - context.configure(url=url) + context.configure(url=url, target_metadata=target_metadata) with context.begin_transaction(): context.run_migrations() diff --git a/alembic/templates/multidb/env.py b/alembic/templates/multidb/env.py index a9cd393..e3511de 100644 --- a/alembic/templates/multidb/env.py +++ b/alembic/templates/multidb/env.py @@ -65,7 +65,8 @@ def run_migrations_offline(): file_ = "%s.sql" % name logger.info("Writing output to %s" % file_) with open(file_, 'w') as buffer: - context.configure(url=rec['url'], output_buffer=buffer) + context.configure(url=rec['url'], output_buffer=buffer, + target_metadata=target_metadata.get(name)) with context.begin_transaction(): context.run_migrations(engine_name=name) diff --git a/alembic/templates/pylons/env.py b/alembic/templates/pylons/env.py index 7cc35d4..36c3fca 100644 --- a/alembic/templates/pylons/env.py +++ b/alembic/templates/pylons/env.py @@ -46,7 +46,7 @@ def run_migrations_offline(): """ context.configure( - url=meta.engine.url) + url=meta.engine.url, target_metadata=target_metadata) with context.begin_transaction(): context.run_migrations() |