#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 David Sanders):
Please paste the _actual_ model field & generated migration for that field so we can determine _exactly_ what is happening. I'm using Django 4.0.6 and the model {{{ class Foo(models.Model): name = models.CharField(max_length=255) label = models.CharField(max_length=255) class Meta: constraints = [ models.UniqueConstraint( "name", "label", name="unique_pair", ), ] }}} generates the migration {{{ migrations.AddConstraint( model_name='foo', constraint=models.UniqueConstraint(django.db.models.expressions.F('name'), django.db.models.expressions.F('label'), name='unique_pair'), ), }}} -- Ticket URL: <https://code.djangoproject.com/ticket/35271#comment:5> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018e0d9a2b5a-18d267b3-ae09-493e-8cba-863bc75eca64-000000%40eu-central-1.amazonses.com.