'Returns 0 if the `document`\'s schema version matches the
code\'s current version for `colname`, -1 if it is higher (you
need to update IVRE), and 1 if it is lower (you need to call
.migrate_schema()).'

def cmp_schema_version(self, colname, document):

    val1 = self.schema_latest_versions.get(colname, 0)
    val2 = document.get('schema_version', 0)
    return ((val1 > val2) - (val1 < val2))
