#26149: Invalid migration generated when using order_with_respect_to and a
unique_together constraint
----------------------------+------------------------------------
     Reporter:  richardxia  |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  1.9
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  1           |      Needs documentation:  0
  Needs tests:  1           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+------------------------------------

Comment (by jdavisp3):

 Replying to [comment:5 anabelensc]:
 > Hello,
 > I did a new attachment with the test and patch, could you check, please?
 Could I do the PR?
 > Thank you.

 Hi, I think there might be a better way to fix this bug. When computing
 dependencies for `index_together` and `unique_together` fields, the
 autodetector seems to add dependencies on all the related fields on the
 model, rather than dependencies on the actual fields in the compound
 index, which might not be related fields at all. They should depend on
 exactly the fields they index and `check_dependencies` should return True
 if the operation is `AlterOrderWithRespectTo` and the dependency is on the
 `_order` fields.

--
Ticket URL: <https://code.djangoproject.com/ticket/26149#comment:6>
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/068.37e5d6e636e1dae10d0dfd17275cd913%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to