You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Django 3.2, it has been possible to set the field class used for default primary keys using DEFAULT_AUTO_FIELD.
If a project uses DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' then Django will think that this app is missing a migration, because 0001 specifies the field as a plain AutoField.
AutoField supports up to 2 billion records in all database engines, and any installation needing more files that that would probably benefit from storing the files outside the database anyway.
Since Django 3.2, it has been possible to set the field class used for default primary keys using
DEFAULT_AUTO_FIELD
.If a project uses
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
then Django will think that this app is missing a migration, because0001
specifies the field as a plainAutoField
.AutoField
supports up to 2 billion records in all database engines, and any installation needing more files that that would probably benefit from storing the files outside the database anyway.AppConfig.default_auto_field
can be used to set the field used for primary keys on an app by app basis, overriding what is set inDEFAULT_AUTO_FIELD
. See https://docs.djangoproject.com/en/3.2/ref/applications/#django.apps.AppConfig.default_auto_field.Therefore, we should:
default_auto_field = "django.db.models.AutoField"
toDatabaseFilesAppConfig
The text was updated successfully, but these errors were encountered: