﻿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
32256	squashmigrations optimizer crashes when fields' names are swapped using a temporary name	InvalidInterrupt	Hasan Ramezani	"If you rename fields using a pattern like `a->c; b->a; c->b` (such as if previously `DateTimeField`s using `auto_now` and `auto_now_add` had been mixed-up) and then attempt to `squashmigrations` with an optimization barrier between the `CreateModel` and `RenameField`s, the migration optimizer will attempt to create a `CreateModel` operation object with two fields using the same name and fail. I'll attach a migration file that triggers the failure.

I believe the root cause of this issue is that `django.db.migrations.operations.fields.RenameField` allows itself to optimize through (i.e be moved to the right of, I may have gotten this terminology wrong) other `RenameField` operations that reference `old_name`."	Bug	closed	Migrations	3.1	Normal	fixed		InvalidInterrupt	Ready for checkin	1	0	0	0	0	0
