﻿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
23614	Altering unique_together sometimes missing deleted fields	no	Markus Holtermann	"
Steps to reproduce:
1. Create an App `spam`
2. Create two models `spam.Eggs` and `spam.Spam`

{{{
#!python

class Eggs(models.Model):
    pass


class Spam(models.Model):
    class Meta:
        unique_together = (
           ('a', 'b'),
        )
	
    a = models.ForeignKey(Eggs)
    b = models.CharField(max_length=10)
}}}

3. Make migrations
4. Create an App `ham`
5. Create model `ham.Ham`

{{{
#!python
class Ham(models.Model): pass
}}}
6. Add foreignkey to `Spam.Spam`: `c = models.ForeignKey('ham.Ham')`
7. Make Migrations
8. Delete field `Spam.a`
9. Change `Spam.unique_together` to `('c', 'b')`
10. Make Migrations
11. Run migrations.

Output:

> django.db.models.fields.FieldDoesNotExist: Spam has no field named u'a'


I think this might be related to issue #23505 since that is what I was actually trying to reproduce."	Bug	closed	Migrations	1.7	Normal	fixed		github@… info+coding@…	Accepted	0	0	1	0	0	0
