{{{
class Something(models.Model):
field1 = ...
field2 = ...
}}}
adding a field
{{{
something_id = models.AutoField(verbose_name='ID', serialize=False,
auto_created=True, primary_key=True)^M
}}}
generates a "rename" in the migration from "id" to "something_id".
However, for
{{{
class MyModel(models.Model):
field1 = ...
field2 = ...
}}}
adding a field
{{{
mymodel_id = models.AutoField(verbose_name='ID', serialize=False,
auto_created=True, primary_key=True)^M
}}}
does not generate a "rename" in the migration.
--
Ticket URL: <https://code.djangoproject.com/ticket/29378>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Simon Charette):
Can you confirm the issue still happens if you remove `serialize` and
`primary_key`? These flags shouldn't be when declaring a PK explicitly.
--
Ticket URL: <https://code.djangoproject.com/ticket/29378#comment:1>
* status: new => closed
* resolution: => worksforme
* component: Uncategorized => Migrations
* type: Uncategorized => Bug
Comment:
I'm not able to reproduce:
{{{
$ python manage.py makemigrations
Did you rename mymodel.id to mymodel.mymodel_id (a AutoField)? [y/N]
}}}
The model:
{{{
class MyModel(models.Model):
mymodel_id = models.AutoField(verbose_name='ID', serialize=False,
auto_created=True, primary_key=True)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29378#comment:2>