title: Django Migrations - Dependencies reference nonexistent parent node
body: <p>Unlike normal migrations, this is a different one. I have deleted the entire project and database. Used a basic Django project without any app in it. The error always points to my older migrations. To ensure I used default SQL lite.</p>
  
  <p>Steps lead to this error: I tried adding columns to the Group Model using <code>add_to_class</code> and <code>contribute_to_class</code> methods. In the process of doing this, I lost track of the migration. </p>
  
  <pre><code>Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrapper at 0x000001E7701610D0&gt;
    Traceback (most recent call last):
      File "E:\Python_365\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
        fn(*args, **kwargs)
      File "E:\Python_365\lib\site-packages\django\core\management\commands\runserver.py", line 123, in inner_run
        self.check_migrations()
      File "E:\Python_365\lib\site-packages\django\core\management\base.py", line 427, in check_migrations
        executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
      File "E:\Python_365\lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
        self.loader = MigrationLoader(self.connection)
      File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
        self.build_graph()
      File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 267, in build_graph
        raise exc
      File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 241, in build_graph
        self.graph.validate_consistency()
      File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 243, in validate_consistency
        [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
      File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 243, in &lt;listcomp&gt;
        [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
      File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 96, in raise_error
        raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
    django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0022_group_openid dependencies reference nonexistent parent node ('Task', '0003_auto_20181107_1811')
  </code></pre>
  
  <p>I am not sure why Django is still referring to my migration which of other projects. This is not letting me migrate my other project as well, getting the same error everywhere.</p>