Commits

Bryce Lohr  committed 4500a20

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.

  • Participants
  • Parent commits 7cdba99

Comments (0)

Files changed (2)

File alembic/templates/multidb/env.py

                     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.
                         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():

File alembic/templates/multidb/script.py.mako

 
 
 def downgrade(engine):
-    eval("upgrade_%s" % engine.name)()
+    eval("downgrade_%s" % engine.name)()
 
 
 % for engine in ["engine1", "engine2"]:
 def downgrade_${engine}():
     ${context.get("%s_downgrades" % engine, "pass")}
 
-% endfor
+% endfor