#34964: Reversing the order of Q objects in a CheckConstraint generates a
migration
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: noop | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):
Simon's suggestion on the PR was to sort Q objects in the constructor of
`CheckConstraint` so that we wouldn't even get into a situation where the
autodetector would be remaining quiet even with SQL changes. I see that
this would come at the cost of causing migrations to be emitted for
existing projects, though, so we might want a release note.
The case that originally prompted me to open a ticket was for a migration
dropping and recreating a constraint with the exact same SQL, e.g.
changing `Q(A) & Q(B)` to `Q(A, B)` . I just added a regression test for
this case.
--
Ticket URL: <https://code.djangoproject.com/ticket/34964#comment:4>
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/0107018bc45cbc40-b2022723-8fb0-405e-b982-616bf6231cd3-000000%40eu-central-1.amazonses.com.