Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 3
0
def drop_db():
    engine = session.get_engine()
    models.unregister_models(engine)
Ejemplo n.º 4
0
def setup_db():
    engine = session.get_engine()
    models.register_models(engine)
Ejemplo n.º 5
0
def reset_dummy_db():
    models.unregister_models(session.get_engine())
Ejemplo n.º 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())