Example #1
0
def version(engine=None):
    """Returns current database version."""
    engine = engine or db_session.get_engine()
    with engine.connect() as conn:
        context = alembic_migration.MigrationContext.configure(conn)
        return context.get_current_revision()
Example #2
0
def version(engine=None):
    """Returns current database version."""
    engine = engine or db_session.get_engine()
    with engine.connect() as conn:
        context = alembic_migration.MigrationContext.configure(conn)
        return context.get_current_revision()
Example #3
0
def drop_db():
    engine = session.get_engine()
    models.unregister_models(engine)
Example #4
0
def setup_db():
    engine = session.get_engine()
    models.register_models(engine)
Example #5
0
def reset_dummy_db():
    models.unregister_models(session.get_engine())
Example #6
0
def setup_dummy_db():
    options.cfg.set_defaults(options.database_opts, sqlite_synchronous=False)
    options.set_defaults(sql_connection="sqlite://", sqlite_db='murano.db')
    models.register_models(session.get_engine())