Running makemigrations in Django 3.2+ with DEFAULT_AUTO_FIELD set to django.db.models.AutoField will generate extra migrations for this package, this PR will fix it.
Reason:
On Django 3.2+, by default the auto field is determined by DEFAULT_AUTO_FIELD in settings
Current version works if it is set to BigAutoField, as the migration is added in #83.
However when it is set to AutoField, it will apply to both models in the package, generating a migration.
And since we need to maintain compatibility to more Django version and default_auto_field in AppConfig is only supported in 3.2+, we need to explicitly declare id field to both models. I had checked it should not generate extra migration in my cases.
Running
makemigrations
in Django 3.2+ withDEFAULT_AUTO_FIELD
set todjango.db.models.AutoField
will generate extra migrations for this package, this PR will fix it.Reason:
DEFAULT_AUTO_FIELD
in settingsBigAutoField
, as the migration is added in #83.AutoField
, it will apply to both models in the package, generating a migration.And since we need to maintain compatibility to more Django version and
default_auto_field
inAppConfig
is only supported in 3.2+, we need to explicitly declareid
field to both models. I had checked it should not generate extra migration in my cases.