-1

I deleted some migration files that were giving me the error. Then when I write "python3 manage.py showmigrations" I get the following error:

root@chat-manager:/var/www/jinabot# python3 manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 23, in <module>
    main()
  File "manage.py", line 19, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 419, in exe
    utility.execute()
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 413, in exe
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 354, in run_fro
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/commands/makemigrations.py", l
    loader = MigrationLoader(None, ignore_no_migrations=True)
  File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/loader.py", line 53, in __init__
    self.build_graph()
  File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/loader.py", line 259, in build_g
    self.graph.validate_consistency()
  File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 195, in validate
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 195, in <listcom
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 58, in raise_err
    raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration app.0172_auto_20220603_1746 dependencie
_auto_20220601_2313')

How to fix it?

1 Answers1

0

If you have such an error at the development stage, then I don’t know if this is correct, but I would probably delete all the migrations of the conflicting application and the database too, and then run "python manage.py makemigrations" (Sorry, comments are not available to me)

sk1p
  • 77
  • 9
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 03 '22 at 19:33
  • In this case, no data will be deleted? – Fut Studio Jun 03 '22 at 21:04
  • If you delete the database, all information in it will also be deleted. If you delete only the migrations, then the data will be saved, but I can’t say if this will solve your problem. At the development stage, I usually don’t have important data, and I don’t want to deal with errors in migrations in detail – sk1p Jun 03 '22 at 21:38