migration error after deleting app (NodeNotFoundError))

Couple of different options, each with various potential issues. (Note, you could still have problems with things like the migrations table and the content type table.)

  • Delete all migrations and redo makemigrations

  • Edit the individual migration files to refer to the proper predecessor

  • (Safest route) Drop your database and rebuild from scratch

  • Recover your deleted app along with the migrations, delete the models in the app, do another makemigrations, then squash the migrations - hopefully that might remove all the intermediate steps.

Also see: Removing app in django 1.11, which references this blog post: Cleanly removing a Django app (with models)

2 Likes