﻿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
22432	Switching model on an M2M field results in a broken db (no change to the automatic through table)	Stephen Burrows	Raphaël Barrois	"I had a field that looked like this:

{{{
class EventPerson(models.Model)
    person_prefer = models.ManyToManyField('self')
}}}

But that was wrong (copy-paste mistake) so I switched it to this:

{{{
class EventPerson(models.Model):
    person_prefer = models.ManyToManyField(Person)
}}}

Then I ran makemigrations and migrate. And now I'm getting database errors because the auto-generated through table still looks like this:

{{{
CREATE TABLE ""brambling_eventperson_person_prefer""
(""id"" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
 ""from_eventperson_id"" integer NOT NULL REFERENCES ""brambling_eventperson"" (""id""),
 ""to_eventperson_id"" integer NOT NULL REFERENCES ""brambling_eventperson"" (""id""),
UNIQUE (""from_eventperson_id"", ""to_eventperson_id""));
}}}

... and I have no easy way to recover."	Bug	closed	Migrations	1.7-beta-1	Release blocker	fixed		stephen.r.burrows@…	Accepted	1	0	0	0	0	0
