﻿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
24653	Migrations: Removing a field with foreign key constraint fails	László Károlyi	nobody	"Hey,

I have a model that has a foreign key to another model. Let's say I change my mind and want the relation the other way around (the another model having a foreign key to my model), and so I modify the models accordingly, removing the foreign key of my model.

This creates a migration with a `migrations.RemoveField` on the model, which is just right. But when running this migration on MySQL, I get an error saying

{{{
django.db.utils.OperationalError: (1553, ""Cannot drop index 'base_comment_f6be1d8d': needed in a foreign key constraint"")
}}}
and the migration fails.

Shouldn't the `migrations.RemoveField` drop that constraint automatically?

This happens using python 3, might have to do something with #24390."	Bug	new	Migrations	1.8	Normal		foreign key constraint mysql		Unreviewed	0	0	0	0	0	0
