

def run_migrations_online():
    "Run migrations in 'online' mode.\n\n    In this scenario we need to create an Engine\n    and associate a connection with the context.\n\n    "
    engines = {
        
    }
    for name in re.split(',\\s*', db_names):
        engines[name] = rec = {
            
        }
        rec['engine'] = engine_from_config(context.config.get_section(name), prefix='sqlalchemy.', poolclass=pool.NullPool)
    for (name, rec) in engines.items():
        engine = rec['engine']
        rec['connection'] = conn = engine.connect()
        if USE_TWOPHASE:
            rec['transaction'] = conn.begin_twophase()
        else:
            rec['transaction'] = conn.begin()
    try:
        for (name, rec) in engines.items():
            logger.info(('Migrating database %s' % name))
            context.configure(connection=rec['connection'], upgrade_token=('%s_upgrades' % name), downgrade_token=('%s_downgrades' % rec), target_metadata=target_metadata.get(name))
            context.run_migrations(engine_name=name)
        if USE_TWOPHASE:
            for rec in engines.values():
                rec['transaction'].prepare()
        for rec in engines.values():
            rec['transaction'].commit()
    except:
        for rec in engines.values():
            rec['transaction'].rollback()
        raise
    finally:
        for rec in engines.values():
            rec['connection'].close()

dataset/ETHPy150Open quantmind/lux/lux/extensions/odm/commands/template/lux/env.py run_migrations_online/VarMisuse@195/314 `name`->`rec`