﻿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
27121	Migrate Fails When Column is Deleted and Unique Together is modified in the same migration	Chris Reedy	nobody	"I discovered a bug that causes a migration to fail when a column is deleted in a migration and unique together is modified in the same migration.  The following are the steps to reproduce the bug:
{{{
   # Consider this your model:
   class Fruit (models.Model):
     taste = models.CharField(max_length=40)
     color = models.CharField(max_length=40)
     shape = models.CharField(max_length=40)

        class Meta:
          unique_together = ('taste', 'color', 'shape')
}}}
Now, if you delete the field 'shape' and remove it from the unique together in the same migration so the model looks as follows:
{{{
   # Updated model:
   class Fruit (models.Model):
        taste = models.CharField(max_length=40)
        color = models.CharField(max_length=40)

        class Meta:
          unique_together = ('taste', 'color')
}}
Migration will fail in modifying the unique_together and throw an error that the Fruit has no field named 'shape'  I think that this is because the delete of the column is processed before the unique index is updated."	Bug	closed	Migrations	1.9	Normal	duplicate	migration failure no field		Unreviewed	0	0	0	0	0	0
