-
Notifications
You must be signed in to change notification settings - Fork 21
Description
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.
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 in DEFAULT_AUTO_FIELD. See https://docs.djangoproject.com/en/3.2/ref/applications/#django.apps.AppConfig.default_auto_field.
Therefore, we should:
- add
default_auto_field = "django.db.models.AutoField"toDatabaseFilesAppConfig - remove support for Django < 3.2