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()
def drop_db(): engine = session.get_engine() models.unregister_models(engine)
def setup_db(): engine = session.get_engine() models.register_models(engine)
def reset_dummy_db(): models.unregister_models(session.get_engine())
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())