﻿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
30065	Migration crash on removal of field in unique together.	ZaArsProgger	nobody	"I found bug in migrations.

I had Model2 with FK to other Model1 and unique_key (model1, ...)
Then I changed Model2 - removed FK to Model1, created FK to Model3 and changed unique_key on (model3, ...)

It resulted as follows:
{{{
        migrations.RemoveField(
            model_name='model1',
            name='model1',
        ),
        migrations.AlterUniqueTogether(
            name='model1',
            unique_together=set([('model3', 'day', 'comment')]),
        ),
}}}
Applying migrations raised django.core.exceptions.FieldDoesNotExist

It was corrected when I interchanged operations 

{{{
        migrations.AlterUniqueTogether(
            name='model1',
            unique_together=set([('model3', 'day', 'comment')]),
        ),
        migrations.RemoveField(
            model_name='model1',
            name='model1',
        ),
}}}"	Bug	closed	Migrations	1.11	Normal	duplicate	migration, unique, together, model		Unreviewed	0	0	0	0	0	0
