title: Django migrations - django.db.migrations.exceptions.NodeNotFoundError
body: <p>I get the following error when I run any python manage.py function:</p>
  
  <p><code>raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
  django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0010_user_following dependencies reference nonexistent parent node ('accounts', '0002_auto_20180615_2021')</code></p>
  
  <p>It happened after I tried to reset my migrations by manually deleting the migration files in the migration folders (except the <strong>init</strong> files - no other files are left in the migration folders).</p>
  
  <p>I have tried dropping the database with python manage.py flush, which also doesn't run. </p>
  
  <p>Any suggestions? Thanks!</p>
  
  <p><strong>SOLUTION:</strong>
  After a week of google search I ended up reconstructing the referenced migration files manually using the documentation: <a href="https://docs.djangoproject.com/en/2.0/howto/writing-migrations/" rel="noreferrer">https://docs.djangoproject.com/en/2.0/howto/writing-migrations/</a></p>
  
  <p>After that the manage.py migrate and makemigration functions worked again. Never delete migration files without taking a backup first!</p>