#23740: Cannot drop unique_together constraint on a single field with its own unique=True constraint ---------------------------------+------------------------------------ Reporter: lanzz | Owner: nobody Type: Bug | Status: new Component: Migrations | Version: 1.7 Severity: Normal | Resolution: Keywords: unique_together | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+------------------------------------
Comment (by jdavisp3): Replying to [comment:5 matthewwestcott]: > Can't see a good way of fixing this without breaking backwards compatibility. The alter_unique_together logic in db/backends/schema.py relies on the UNIQUE constraints generated by unique_together to be distinguishable within the database from constraints generated through other mechanisms (e.g. unique=True) - but this isn't possible when the unique_together rule only contains a single field. I have encountered this same issue. Could you explain the backwards compatibility issue here? It seems to me that the bug is in attempting to drop or create an index when that is not called for, either because the index is required by a different constraint or was already created by another constraint. Is that behavior that needs to be kept. -- Ticket URL: <https://code.djangoproject.com/ticket/23740#comment:6> 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 post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.c925d275be041333cec9fadbe4649b29%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.