Skip to content

Missing migration on recent Django #56

Open
@rhunwicks

Description

@rhunwicks

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" to DatabaseFilesAppConfig
  • remove support for Django < 3.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions