﻿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
29495	When altering unique_together and removing a field, migrations may get wrong order.	Curtis Maloney	nobody	"I just ran into a case where I was updating a model Trip, replacing one FK (owner) with another.
The model had an existing unique_together constraint including the old FK.

I'd written and applied migrations adding the new FK and setting its value.
When I created the migration to remove the old FK, the RemoveField was inserted _before_ the AlterUniqueTogether.

Since the field was removed first, the error comes:

    django.core.exceptions.FieldDoesNotExist: Trip has no field named 'owner'


I fixed it by manually reordering the operations in the migration.
"	Bug	closed	Migrations	2.0	Normal	duplicate	migrations		Unreviewed	0	0	0	0	0	0
