Django migration dependencies reference nonexistent parent node

后端 未结 1 1871
心在旅途
心在旅途 2021-01-14 23:00

I have a problem with django migrations. I get this error:

django.db.migrations.exceptions.NodeNotFoundError: Migration user.0050_merge_20170523_1254

相关标签:
1条回答
  • 2021-01-14 23:52

    Next time when you rollback:

    1. Go into the migrations folder in your app.
    2. Look for the migration file where you would like to go back to. (for example "0012_post_category.py")
    3. go in the terminal write: ./manage.py migrate yourAppName 0012 (this is just the example number) and hit enter
    4. 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.

    0 讨论(0)
提交回复
热议问题