Skip to content

Commit 0c13927

Browse files
authored
Add JSONField check constraints
1 parent 7b7ed31 commit 0c13927

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

mssql/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
106106
'SmallAutoField': 'IDENTITY (1, 1)',
107107
}
108108
data_type_check_constraints = {
109+
'JSONField': '(ISJSON ("%(column)s") = 1)',
109110
'PositiveIntegerField': '[%(column)s] >= 0',
110111
'PositiveSmallIntegerField': '[%(column)s] >= 0',
111112
}

testapp/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
'model_fields.test_jsonfield.TestQuerying.test_key_quoted_string',
197197
'model_fields.test_jsonfield.TestQuerying.test_lookups_with_key_transform',
198198
'model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_count',
199-
'model_fields.test_jsonfield.JSONFieldTests.test_db_check_constraints',
200199
'model_fields.test_jsonfield.TestQuerying.test_isnull_key',
201200
'model_fields.test_jsonfield.TestQuerying.test_none_key',
202201
'model_fields.test_jsonfield.TestQuerying.test_none_key_and_exact_lookup',

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ envlist =
88
[testenv]
99
allowlist_externals =
1010
/bin/bash
11+
/usr/bin/bash
1112
C:\Program Files\Git\bin\bash.EXE
1213

1314
commands =

0 commit comments

Comments
 (0)