diff options
| author | Tim Graham <timograham@gmail.com> | 2025-08-19 15:08:43 -0400 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-09-05 10:43:10 -0400 |
| commit | 2a636118dacdcda074c99ebd50311d64a8cca367 (patch) | |
| tree | f5b11c60f9fd598429d6ab60b35515a6c6d82256 /django/db | |
| parent | 0ddbe12ea99a2dc1b757dc2015ba8bb6bfd9d653 (diff) | |
Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/postgresql/features.py | 9 | ||||
| -rw-r--r-- | django/db/models/base.py | 33 |
2 files changed, 9 insertions, 33 deletions
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index 83e6b5cf7f..419fad8686 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -123,6 +123,15 @@ class DatabaseFeatures(BaseDatabaseFeatures): "test_group_by_nested_expression_with_params", } ) + if not is_psycopg3: + expected_failures.update( + { + # operator does not exist: bigint[] = integer[] + "postgres_tests.test_array.TestQuerying.test_gt", + "postgres_tests.test_array.TestQuerying.test_in", + "postgres_tests.test_array.TestQuerying.test_lt", + } + ) return expected_failures @cached_property diff --git a/django/db/models/base.py b/django/db/models/base.py index 7c20319da6..3827b00346 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1701,7 +1701,6 @@ class Model(AltersData, metaclass=ModelBase): *cls._check_indexes(databases), *cls._check_ordering(), *cls._check_constraints(databases), - *cls._check_default_pk(), *cls._check_db_table_comment(databases), *cls._check_composite_pk(), ] @@ -1709,38 +1708,6 @@ class Model(AltersData, metaclass=ModelBase): return errors @classmethod - def _check_default_pk(cls): - if ( - not cls._meta.abstract - and cls._meta.pk.auto_created - and - # Inherited PKs are checked in parents models. - not ( - isinstance(cls._meta.pk, OneToOneField) - and cls._meta.pk.remote_field.parent_link - ) - and not settings.is_overridden("DEFAULT_AUTO_FIELD") - and cls._meta.app_config - and not cls._meta.app_config._is_default_auto_field_overridden - ): - return [ - checks.Warning( - f"Auto-created primary key used when not defining a " - f"primary key type, by default " - f"'{settings.DEFAULT_AUTO_FIELD}'.", - hint=( - f"Configure the DEFAULT_AUTO_FIELD setting or the " - f"{cls._meta.app_config.__class__.__qualname__}." - f"default_auto_field attribute to point to a subclass " - f"of AutoField, e.g. 'django.db.models.BigAutoField'." - ), - obj=cls, - id="models.W042", - ), - ] - return [] - - @classmethod def _check_composite_pk(cls): errors = [] meta = cls._meta |
