0

I created a django application so along the line I wanted to reset the entire database so I deleted the database and deleted all migration files. it is not the first time I have done such which I assume is not a bad way of doing it. so I ran the command like python manage.py makemigrations and I got this error in my terminal

 django.db.migrations.exceptions.NodeNotFoundError: 
Migration auth.0009_user_following dependencies reference nonexistent parent node (u'profiles', u'0001_initial')

I am totally confused and I dont have any idea on what to do next. HELP

King
  • 1,885
  • 3
  • 27
  • 84

2 Answers2

3

You have a custom migrations in your generic app auth, just delete the file:

VIRTUALENV_PATH/lib/python2.7/site-packages/django/contrib/auth/migrations/auth.0009_user_following
user2021091
  • 561
  • 2
  • 11
  • I have a question. I created a following and unfollowing app. initially users can follow each other but later I realized it was not working again and those that have been followed can not be unfollowed again. this was why I deleted the database initially. any thing I can do? – King Aug 28 '17 at 14:16
  • 2) can I delete all the migrations present in this location `VIRTUALENV_PATH/lib/python2.7/site-packages/django/contrib/auth/migrations/` – King Aug 28 '17 at 14:19
  • then mark the question as accepted. 1. it depends of your code, how do you follow someone ? 2. Absolutely not, you will break django if you do it – user2021091 Aug 28 '17 at 14:21
  • This is the link to my code. https://stackoverflow.com/questions/45880197/django-ajax-follow-and-unfollow?noredirect=1#comment78746103_45880197 – King Aug 28 '17 at 14:24
  • Hi @uswe2021091 I need you help regarding a question. https://stackoverflow.com/questions/46263867/creating-relationship-between-two-apps-in-django – King Sep 18 '17 at 10:04
0

You need to run this to get the initial migration:

python manage.py makemigrations <nameofyourapp>

Then run

python manage.py migrate
M3RS
  • 6,720
  • 6
  • 37
  • 47