A simple reproducer is to create a new project, change the setting as
follows:
{{{
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
}}}
and adding a simple model such as:
{{{
class SampleModel(models.Model):
name = models.TextField(unique=True)
}}}
After running `./manage.py makemigrations` the following migration is
generated:
{{{
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='SampleModel',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField(unique=True)),
],
),
]
}}}
Same behavior can be reproduced both in 3.2 and 4.1.7.
--
Ticket URL: <https://code.djangoproject.com/ticket/34382>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
* component: Uncategorized => Database layer (models, ORM)
Comment:
Thanks for this report, however it works for me. You can check
`AppConfig.default_auto_field` in your apps, it's probably set to
`BigAutoField`, see
[https://docs.djangoproject.com/en/stable/topics/db/models/#automatic-
primary-key-fields "Automatic primary key fields"] for more details.
--
Ticket URL: <https://code.djangoproject.com/ticket/34382#comment:1>