Example #1
0
def run_migration(target, engine=None):
    engine = engine or session.get_engine()
    engine.connect()
    config = alembic_config.Config(os.path.join(script_location,
                                                'alembic.ini'))
    config.set_main_option('script_location', 'subunit2sql:migrations')
    config.subunit2sql_config = CONF
    with engine.begin() as connection:
        config.attributes['connection'] = connection
        command.upgrade(config, target)
    engine.dispose()
Example #2
0
def run_migration(target, engine=None):
    engine = engine or session.get_engine()
    engine.connect()
    config = alembic_config.Config(os.path.join(script_location,
                                                'alembic.ini'))
    config.set_main_option('script_location', 'subunit2sql:migrations')
    config.subunit2sql_config = CONF
    with engine.begin() as connection:
        config.attributes['connection'] = connection
        command.upgrade(config, target)
    engine.dispose()
Example #3
0
 def reset(self):
     self._cache_schema()
     engine = session.get_engine()
     engine.dispose()
     engine.connect()
Example #4
0
 def cleanup(self):
     engine = session.get_engine()
     engine.dispose()
 def reset(self):
     self._cache_schema()
     engine = session.get_engine()
     engine.dispose()
     engine.connect()
 def cleanup(self):
     engine = session.get_engine()
     engine.dispose()