#31351: Need warning when UniqueConstraint with condition is used but supports_partial_indexes is False -------------------------------------+------------------------------------- Reporter: Matthijs | Owner: nobody Kooijman | Type: | Status: new Uncategorized | Component: Database | Version: master layer (models, ORM) | Severity: Normal | Keywords: Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | -------------------------------------+------------------------------------- Databases that support supports_partial_indexes allow using a `UniqueConstraint` with a `condition` specified (implemented in #29547 and #30062). However, when such constraints are specified, but the database (e.g. Mysql/Mariadb or older versions of sqlite) does not support partial indexes, these constraints are silently ignored.
It would be better if this would give a warning, similar to the warning for `CheckConstraints` at https://github.com/django/django/blob/9358da704ea9ba55f22df912e47b54eb85d5c97e/django/db/models/base.py#L1838-L1862 I have observed this with 2.2.10, but looking at the code, this has not changed since then, so I'm setting version to master. This is probably a fairly trivial change, but I'm not in the opportunity to provide a PR in the near future. -- Ticket URL: <https://code.djangoproject.com/ticket/31351> 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/059.e9a934c11dcef06280802bdc9de96951%40djangoproject.com.