#35079: Meta indexes/constraints with OpClass on expressions crash.
--------------------------------+------------------------------------
Reporter: andraantariksa | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Mariusz Felisiak):
* cc: Lily Foote, Hannes Ljungberg (added)
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. I'm puzzled because almost
[https://github.com/django/django/blob/f412add786dfc18424eee6281ec8cc97220b04fc/tests/postgres_tests/test_constraints.py#L239-L244
the same works] in our test suite and I confirmed that both `Index` and
`UniqueConstraint` crash on:
{{{#!python
class Location(models.Model):
name = models.CharField(max_length=255)
scene = models.TextField(null=True)
class Meta:
indexes = [
models.Index(
OpClass(Upper('name'), name='varchar_pattern_ops'),
name='uppercase_name_index'
),
]
constraints = [
models.UniqueConstraint(
OpClass(Upper("scene"), name="varchar_pattern_ops"),
name="test_opclass_func",
)
]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35079#comment:2>
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/0107018cc9bb4330-1b26d57c-dce7-4a77-9893-f23f4704c959-000000%40eu-central-1.amazonses.com.