#26223: Squashing migrations with preserve_default=False keeps the default
--------------------------------+------------------------------------
Reporter: bartekwojcicki | Owner: vytisb
Type: Bug | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Comment (by vytisb):
I found another faulty optimization for `AddField`+`AlterField`:
{{{
#!div style="font-size: 80%"
{{{#!python
>>> optimize([
... migrations.AddField("Foo", "value",
models.IntegerField(default=42), preserve_default=False),
... migrations.AlterField("Foo", "value",
models.IntegerField("Value")),
... ])
[
migrations.AddField(
model_name='Foo',
name='value',
field=models.IntegerField(verbose_name='Value'),
),
]
}}}
}}}
PR updated to deal with it.
--
Ticket URL: <https://code.djangoproject.com/ticket/26223#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.c4f2561368e6d92402aac04d6e8d185f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.