def verify_db_schema_version(conn):
    'Function used to check whether the DB schema version matches the code schema version.'
    logger = logging.getLogger('dirbs.db')
    version = query_db_schema_version(conn)
    if (version != code_db_schema_version):
        if (version is None):
            logger.error('DB schema has not been installed via dirbs-db install!')
            raise DatabaseSchemaException('No DB schema installed - perform a dirbs-db install first!')
        else:
            logger.error('DB schema version does not match code!')
            logger.error('Code schema version: %d', code_db_schema_version)
            logger.error('DB schema version: %d', version)
            raise DatabaseSchemaException('Mismatch between code and DB schema versions - perform a dirbs-db upgrade!')
Function used to check whether the DB schema version matches the code schema version.
def verify_db_schema_version(conn):
    
    logger = logging.getLogger('dirbs.db')
    version = query_db_schema_version(conn)
    if (version != code_db_schema_version):
        if (version is None):
            logger.error('DB schema has not been installed via dirbs-db install!')
            raise DatabaseSchemaException('No DB schema installed - perform a dirbs-db install first!')
        else:
            logger.error('DB schema version does not match code!')
            logger.error('Code schema version: %d', code_db_schema_version)
            logger.error('DB schema version: %d', version)
            raise DatabaseSchemaException('Mismatch between code and DB schema versions - perform a dirbs-db upgrade!')