Skip to content

Commit e917172

Browse files
committed
update for Django 6.1
1 parent 8f65192 commit e917172

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

django-test-suite/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION=$1
77

88
# clone django into the repo.
99
rm -rf _django_repo
10-
git clone --depth 1 --single-branch --branch cockroach-6.0.x https://github.com/timgraham/django _django_repo
10+
git clone --depth 1 --single-branch --branch cockroach-6.1.x https://github.com/timgraham/django _django_repo
1111

1212
# install the django requirements.
1313
cd _django_repo/tests/

django_cockroachdb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '6.0'
1+
__version__ = '6.1a0'
22

33
# Check Django compatibility before other imports which may fail if the
44
# wrong version of Django is installed.

django_cockroachdb/features.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class DatabaseFeatures(PostgresDatabaseFeatures):
4848
# https://github.com/cockroachdb/cockroach/issues/95068
4949
supports_comments = False
5050

51+
# CockroachDB doesn't support UNIQUE NULLS NOT DISTINCT:
52+
# https://github.com/cockroachdb/cockroach/issues/115836
53+
supports_nulls_distinct_unique_constraints = False
54+
5155
@cached_property
5256
def introspected_field_types(self):
5357
return {

django_cockroachdb/schema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class DatabaseSchemaEditor(PostgresDatabaseSchemaEditor):
1818

1919
# The PostgreSQL backend uses "SET CONSTRAINTS ... IMMEDIATE" after
2020
# creating this foreign key. This isn't supported by CockroachDB.
21-
sql_create_column_inline_fk = 'CONSTRAINT %(name)s REFERENCES %(to_table)s(%(to_column)s)%(deferrable)s'
21+
sql_create_column_inline_fk = (
22+
'CONSTRAINT %(name)s REFERENCES %(to_table)s(%(to_column)s)'
23+
'%(on_delete_db)s%(deferrable)s'
24+
)
2225

2326
# The PostgreSQL backend uses "SET CONSTRAINTS ... IMMEDIATE" after this
2427
# statement. This isn't supported by CockroachDB.

0 commit comments

Comments
 (0)