#32714 closed Bug (fixed)
Model meta ordering with nulls_last resulting in constantly needing new migrations
Reported by: | Kevin Marsh | Owned by: | Simon Charette |
---|---|---|---|
Component: | Migrations | Version: | 3.2 |
Severity: | Release blocker | Keywords: | |
Cc: | Johannes Maron | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Just upgraded from Django 3.2. to 3.2.1 and now makemigrations
always shows the same change. The issue seems to be if you have:
class SampleModel(models.Model): name = models.CharField(null=True, max_length=255) class Meta: ordering = [F('name').asc(nulls_last=True)]
Running makemigrations
always results in the ordering changing for SampleModel
, think maybe this was introduced when trying to solve #32632 since for:
a = F('name').asc(nulls_last=True) b = F('name').asc(nulls_last=True)
In Django 3.2 a == b
but in Django 3.2.1 a != b
Change History (8)
comment:1 by , 4 years ago
Owner: | changed from | to
---|---|
Severity: | Normal → Release blocker |
Status: | new → assigned |
comment:2 by , 4 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 4 years ago
Mariusz, any chance to speed up release. I'm having trouble to apply the patch for CVE-2021-31542 without this change. And seeing that the patch for CVE-2021-31542 is rather large, I don't really want to backport it.
Likely introduced by https://github.com/django/django/commit/c8b659430556dca0b2fe27cf2ea0f8290dbafecd#diff-359ab56295cce36b9597e1d65185f695f271955617b40f43df58ce3fe76fd0c8R1195