#32714: Model meta ordering with nulls_last resulting in constantly needing new
migrations
---------------------------------------+------------------------
               Reporter:  Kevin Marsh  |          Owner:  nobody
                   Type:  Bug          |         Status:  new
              Component:  Migrations   |        Version:  3.2
               Severity:  Normal       |       Keywords:
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+------------------------
 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`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32714>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.50988e9611e29b8a699f3c9e9b371301%40djangoproject.com.

Reply via email to