id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 26180 Altering unique_together still sometimes missing deleted fields Julian Andrews Akshesh Doshi "This is likely a missed edge case from #23614. Steps to reproduce: 1. Create an app `spam` 2. Create a model `Spam` {{{ class Spam(models.Model): a = models.CharField(max_length=255) b = models.CharField(max_length=255) c = models.CharField(max_length=255) class Meta: unique_together = ( ('a', 'b'), ('b', 'c'), ) }}} 3. Make migrations 4. Delete field `Spam.c` 5. Delete the second `unique_together` constraint (`('b', 'c')`) 6. Make migrations 7. Run migrations Output: {{{ django.core.exceptions.FieldDoesNotExist: Spam has no field named u'c' }}} Note that the bug doesn't occur if no `unique togther` constraints remain. Manually reversing the order of the operations in the migration (to remove the index first) produces a functional migration." Bug closed Migrations 1.9 Normal duplicate Accepted 1 1 1 0 0 0