Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing migration on recent Django #56

Open
rhunwicks opened this issue Aug 17, 2023 · 0 comments
Open

Missing migration on recent Django #56

rhunwicks opened this issue Aug 17, 2023 · 0 comments
Assignees

Comments

@rhunwicks
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants