0
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration home.0001_initial dependencies reference nonexistent parent node ('cms', '0024_auto_20210516_0955')
markwalker_
  • 12,078
  • 7
  • 62
  • 99
Knight
  • 41
  • 4
  • You can `Comment `out the models and then `migrate` it and then apply with your changes again ... this way new files will be generated but first will ramain in` db` as well – Faisal Nazik Jun 05 '21 at 14:29
  • 2
    It's your initial migration itself, meaning likely you have no migrations applied? Looks like the problem is you uninstalled some dependency? Just delete the migrations (don't delete the directory / folder and `__init__.py`) without issues and run `makemigrations` and `migrate` again. – Abdul Aziz Barkat Jun 05 '21 at 14:30
  • @AbdulAzizBarkat actually I tried it already and works but why can't the 0001_initial.py couldn't migrate? – Knight Jun 05 '21 at 15:18
  • Because that migration had a dependency to a 3rd party package that you uninstalled (`cms`) if you didn't uninstall (doesn't matter if you don't use it, you would need it in `INSTALLED_APPS`, etc. just to make your migrations sensible) that then that migration would have been fine. If you don't want to delete then you would need to manually edit your migration files. – Abdul Aziz Barkat Jun 05 '21 at 15:23
  • @AbdulAzizBarkat cms is still installed in top of django .I am using django-cms where cms is installed in Installed_apps . It just don't create the migrations in that 0024_auto_20210516_0955 . – Knight Jun 05 '21 at 15:32
  • @Knight Wait but Django cms _does not_ have a migration `0024` (It only has till `0022`), do you use Django 3.2? Have a look at https://stackoverflow.com/questions/67006488/migrating-models-of-dependencies-when-changing-default-auto-field – Abdul Aziz Barkat Jun 05 '21 at 15:36

0 Answers0