From: Bryce Lohr Date: Thu, 26 Apr 2012 02:50:55 +0000 (-0400) Subject: Fixed kwarg passed in to multidb version scripts to reflect that it's the name, not... X-Git-Tag: rel_0_4_0~8^2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca2c0eddbd96d64fc8026cc0783e900870f731c4;p=thirdparty%2Fsqlalchemy%2Falembic.git Fixed kwarg passed in to multidb version scripts to reflect that it's the name, not the engine object, that gets passed in. Fixed the downgrade side of the multidb env.py template. --- diff --git a/alembic/templates/multidb/env.py b/alembic/templates/multidb/env.py index e0ebbc12..14922595 100644 --- a/alembic/templates/multidb/env.py +++ b/alembic/templates/multidb/env.py @@ -67,7 +67,7 @@ def run_migrations_offline(): output_buffer=open(file_, 'w') ) with context.begin_transaction(): - context.run_migrations(engine=name) + context.run_migrations(engine_name=name) def run_migrations_online(): """Run migrations in 'online' mode. @@ -106,7 +106,7 @@ def run_migrations_online(): target_metadata=target_metadata.get(name) ) context.execute("-- running migrations for engine %s" % name) - context.run_migrations(engine=name) + context.run_migrations(engine_name=name) if USE_TWOPHASE: for rec in engines.values(): diff --git a/alembic/templates/multidb/script.py.mako b/alembic/templates/multidb/script.py.mako index 68d5e72d..d2204257 100644 --- a/alembic/templates/multidb/script.py.mako +++ b/alembic/templates/multidb/script.py.mako @@ -19,7 +19,7 @@ def upgrade(engine): def downgrade(engine): - eval("upgrade_%s" % engine.name)() + eval("downgrade_%s" % engine.name)() % for engine in ["engine1", "engine2"]: @@ -31,4 +31,4 @@ def upgrade_${engine}(): def downgrade_${engine}(): ${context.get("%s_downgrades" % engine, "pass")} -% endfor \ No newline at end of file +% endfor