Ejemplo n.º 1
0
    def _init_db_schema(self):
        global DB_SCHEMA
        if not DB_SCHEMA:

            engine = db_backend.get_engine()
            conn = engine.connect()
            migration.db_sync()
            DB_SCHEMA = "".join(line for line in conn.connection.iterdump())
            engine.dispose()
Ejemplo n.º 2
0
    def _init_db_schema(self):
        global DB_SCHEMA
        if not DB_SCHEMA:

            engine = db_backend.get_engine()
            conn = engine.connect()
            migration.db_sync()
            DB_SCHEMA = "".join(line for line in conn.connection.iterdump())
            engine.dispose()
    def setUpClass(cls):
        super(DbApiTestCase, cls).setUpClass()
        conf = cfg.CONF
        try:
            config.parse_args([], default_config_files=[])
            conf.set_override('connection', 'sqlite://', group='database')
            conf.set_override('sqlite_synchronous', False, group='database')

            engine = session.get_engine()
            conn = engine.connect()
            migration.db_sync()
            cls.DB_SCHEMA = "".join(line
                                    for line in conn.connection.iterdump())
            engine.dispose()
        finally:
            conf.reset()
Ejemplo n.º 4
0
    def setUpClass(cls):
        super(DbApiTestCase, cls).setUpClass()
        conf = cfg.CONF
        try:
            config.parse_args([], default_config_files=[])
            conf.set_override('connection', 'sqlite://', group='database')
            conf.set_override('sqlite_synchronous', False, group='database')

            engine = session.get_engine()
            conn = engine.connect()
            migration.db_sync()
            cls.DB_SCHEMA = "".join(line
                                    for line in conn.connection.iterdump())
            engine.dispose()
        finally:
            conf.reset()
Ejemplo n.º 5
0
def do_db_sync():
    """Place a database under migration control and upgrade,

    creating if necessary.
    """
    migration.db_sync(CONF.command.version)
Ejemplo n.º 6
0
def do_db_sync():
    """Place a database under migration control and upgrade,

    creating if necessary.
    """
    migration.db_sync(CONF.command.version)