#35271: Old migrations with UniqueConstraint fail when using psycopg3
--------------------------------+--------------------------------------
Reporter: Adam ZahradnĂk | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by Adam ZahradnĂk):
When looking at our UniqueConstraint in the model, we never used
`UniqueConstraint(["field"],...)`, but either
`UniqueConstraint(fields=[..])` or `UniqueConstraint("field",...)`. Both
of which are documented in the docs:
https://docs.djangoproject.com/en/5.0/ref/models/constraints/#uniqueconstraint
I see how `UniqueConstraint([...])` would create a wrong constraint, as
the array would be accepted as an expression, but I don't think that is
the problem here.
We already used this model in production for quite some time, and it is
definitely possible to insert values into the table.
--
Ticket URL: <https://code.djangoproject.com/ticket/35271#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/0107018e0d8fbdbd-f38d9223-71b5-483d-8d76-742bb7d47987-000000%40eu-central-1.amazonses.com.