﻿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
36438	makemigrations removes fields in wrong order when GeneratedFields are involved	Colton Saska	Clifford Gama	"Consider a model like PayItem with fields quantity, rate and total.

When total is a GeneratedField dependent on quantity, if you remove quantity and total and generate migrations you get a migration like


{{{
    operations = [
        migrations.RemoveField(
            model_name=""payitem"",
            name=""total"",
        ),
        migrations.RemoveField(
            model_name=""payitem"",
            name=""quantity"",
        ),
    ]
}}}

which will throw django.db.utils.OperationalError: (3108, ""Column 'amount' has a generated column dependency."").

It'd be nice if makemigrations listed operations in the correct order. 
"	Cleanup/optimization	closed	Migrations	5.2	Normal	fixed	generatedfield removefield	Colton Saska	Ready for checkin	1	0	0	0	0	0
