﻿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
28987	Migration changing ManyToManyField target to 'self' doesn't work correctly	MSleepyPanda	Bhuvnesh	"Steps to reproduce:
Create Models:
{{{
class Bar(models.Model):
    pass

class Foo(models.Model):
    bar = models.ManyToManyField('Bar', blank=True)
}}}
Migrate:
{{{
./manage.py makemigrations app
./manage.py migrate
}}}

Change type of the ManyToManyField to Foo:
{{{
class Bar(models.Model):
    pass

class Foo(models.Model):
    bar = models.ManyToManyField('Foo', blank=True)
}}}
Migrate (see above)

In the admin page, navigate to ""add Foo"", click save

You should see an OperationalError, ""no such column: app_foo_bar.from_foo_id""
"	Bug	closed	Migrations	2.0	Normal	fixed	ManyToManyField		Ready for checkin	1	0	0	0	0	0
