@@ -458,6 +458,36 @@ Email
458458 significantly, closely examine any custom subclasses that rely on overriding
459459 undocumented, internal underscore methods.
460460
461+ ``DEFAULT_AUTO_FIELD`` setting now defaults to ``BigAutoField``
462+ ---------------------------------------------------------------
463+
464+ Since Django 3.2 when the :setting:`DEFAULT_AUTO_FIELD` setting was added,
465+ the default :djadmin:`startproject` template's ``settings.py`` contained::
466+
467+ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
468+
469+ and the default :djadmin:`startapp` template's ``AppConfig`` contained::
470+
471+ default_auto_field = "django.db.models.BigAutoField"
472+
473+ At that time, the default value of :setting:`DEFAULT_AUTO_FIELD` remained
474+ :class:`django.db.models.AutoField` for backwards compatibility.
475+
476+ In Django 6.0, :setting:`DEFAULT_AUTO_FIELD` now defaults to
477+ :class:`django.db.models.BigAutoField` and the aforementioned lines in the
478+ project and app templates are removed.
479+
480+ Most projects shouldn't be affected since there has been a system check warning
481+ since Django 3.2 if a project doesn't set :setting:`DEFAULT_AUTO_FIELD`:
482+
483+ **models.W042**: Auto-created primary key used when not defining a primary
484+ key type, by default ``django.db.models.AutoField``.
485+
486+ If you haven't dealt with this warning by now, add
487+ ``DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'`` to your project's
488+ settings, or ``default_auto_field = 'django.db.models.AutoField'`` to an app's
489+ ``AppConfig``, as needed.
490+
461491Custom ORM expressions should return params as a tuple
462492------------------------------------------------------
463493
0 commit comments