Issue
I am using (learning) python/django programming using Eclipse editor. I recently deleted migration files (manually selecting through editor) in migrations folder except init.py file since it was giving some errors with field names that I deleted before. I physically deleted those files. Now when I run makemigrations, it says the dependency files can not be located.
Part of error :
...raise NodeNotFoundError (self.error_message, self.key, origin=self.origin) django.db.migrations.excemption.NOdeNotFoundError: Migration login.0007_auto_20170512_2502 dependancies reference nonexistant parent node ('login','0006_auto_20170515_2226')
Can someone let me know how I could reconstruct the migration files?
Solution
Next time when you rollback:
Go into the migrations folder in your app.
Look for the migration file where you would like to go back to. (for example 0012_post_category.py)
go in the terminal write: ./manage.py migrate yourAppName 0012 (this is just an example number) and hit enter
if everything goes well. Delete the other migrations which came after this number in your migrations folder.
Do not just delete migrations! Hope that helps.
Answered By - hansTheFranz Answer Checked By - David Goodson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.