Пример #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()
Пример #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()
Пример #3
0
 def reset(self):
     self._cache_schema()
     engine = session.get_engine()
     engine.dispose()
     engine.connect()
Пример #4
0
 def cleanup(self):
     engine = session.get_engine()
     engine.dispose()
Пример #5
0
 def reset(self):
     self._cache_schema()
     engine = session.get_engine()
     engine.dispose()
     engine.connect()
Пример #6
0
 def cleanup(self):
     engine = session.get_engine()
     engine.dispose()