title: Migration dependencies reference nonexistent parent node when trying to migrate after db change
body: <p>Before, I used to keep the same db for development and production (postgresql). This isn't the greatest idea, so I made it so that the db I was currently using would only be used in production (and I'd have an sqlite db locally).</p>
  
  <p>Well, I tried to migrate the production db and hot this traceback when trying to migrate at heroku:</p>
  
  <pre><code>(bosnetvenv) michael@michael-VivoBook-ASUSLaptop-MJ401TA:~/projects/znet/bosnet$ heroku run python manage.py migrate
   ›   Warning: heroku update available from 7.35.0 to 7.38.1.
  Running python manage.py migrate on ⬢ zealchain... up, run.1153 (Hobby)
  /app/.heroku/python/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: &lt;http://initd.org/psycopg/docs/install.html#binary-install-from-pypi&gt;.
    """)
  Traceback (most recent call last):
    File "manage.py", line 15, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
      utility.execute()
    File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
      output = self.handle(*args, **options)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 79, in handle
      executor = MigrationExecutor(connection, self.migration_progress_callback)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
      self.loader = MigrationLoader(self.connection)
    File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
      self.build_graph()
    File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/loader.py", line 267, in build_graph
      raise exc
    File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/loader.py", line 241, in build_graph
      self.graph.validate_consistency()
    File "/app/.heroku/python/lib/python3.6/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 "/app/.heroku/python/lib/python3.6/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 "/app/.heroku/python/lib/python3.6/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 engine.0003_auto_20200313_0826 dependencies reference nonexistent parent node ('powerdns_manager', '0007_auto_20200219_0300')
  </code></pre>
  
  <p>powerdns_manager is a package outside my app that I downloaded. Let me know if you need to see the migrations file. Thanks in advance</p>
  
  <p>Edit: BTW, migrations work locally, and they worked in production when i was sharing the same db</p>