예제 #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()