diff --git a/mssql/functions.py b/mssql/functions.py index 2f0fd58..1a5087e 100644 --- a/mssql/functions.py +++ b/mssql/functions.py @@ -281,7 +281,10 @@ def _get_check_sql(self, model, schema_editor): query = Query(model=model, alias_cols=False) else: query = Query(model=model) - where = query.build_where(self.check) + if VERSION >= (5, 1): + where = query.build_where(self.condition) + else: + where = query.build_where(self.check) compiler = query.get_compiler(connection=schema_editor.connection) sql, params = where.as_sql(compiler, schema_editor.connection) if schema_editor.connection.vendor == 'microsoft':