﻿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
25521	squashmigrations tries to add foreign keys to removed models	Kevin Turner	nobody	"I squashed a bunch of migrations in an app we'll call ""foo"". There was something like this going on:

* on foo.Foo add ForeignKey to bar.Bar
* on foo.Foo remove ForeignKey to bar.Bar
* remove model bar.Bar

this ended up with a squashed migration with both AddField and RemoveField in it, which seems inefficient but might have worked. The problem was that, since the target model had been entirely removed in the depended-upon state, the AddField to it didn't work at all. (and failed with some misleading message in `BaseDatabaseSchemaEditor.add_field` about `unicode has no attribute _meta`.)

This was in Django 1.8.5. Haven't tried other versions."	Cleanup/optimization	closed	Migrations	1.8	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
