﻿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
25327	Handling removed apps with dependent migrations?	Aaron C. de Bruyn	nobody	"At one point, I wrote and never released an app called 'djcontacts'.  It stored contact information.
I used it in a large project a few years ago, so I had a lot of ForeignKeys that referenced various models in djcontacts.
Fast-forward to today, and 'djcontacts' needs to die because of various limitations.
I used migrations several months back to migrate all the data, so I have no ForeignKeys referencing djcontacts models, and everything works perfectly.

I finally decided to remove the 'djcontacts' entry from my INSTALLED_APPS, and now I'm getting this:


{{{
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x7f6addae8848>
Traceback (most recent call last):
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/utils/autoreload.py"", line 225, in wrapper
    fn(*args, **kwargs)
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py"", line 112, in inner_run
    self.check_migrations()
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py"", line 164, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/db/migrations/executor.py"", line 19, in __init__
    self.loader = MigrationLoader(self.connection)
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/db/migrations/loader.py"", line 47, in __init__
    self.build_graph()
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/db/migrations/loader.py"", line 312, in build_graph
    _reraise_missing_dependency(migration, parent, e)
  File ""/home/aaron/.virtualenvs/uitintranet/local/lib/python2.7/site-packages/django/db/migrations/loader.py"", line 282, in _reraise_missing_dependency
    raise exc
django.db.migrations.graph.NodeNotFoundError: Migration smiles.0001_initial dependencies reference nonexistent parent node (u'djcontacts', u'0001_initial')
}}}


*The* very first migration I had in my 'smiles' app years ago referenced 'djcontacts'.  Even though 'smiles' currently doesn't have ForeignKeys to djcontacts, it looks like I might need to keep the decrepit app around forever...

One work-around is commenting out the dependency in 0001_initial, but that seems 'hacky' and I'm guessing might cause problems if I ever deploy the application from scratch somewhere else."	Uncategorized	closed	Migrations	1.8	Normal	worksforme			Unreviewed	0	0	0	0	0	0
