【发布时间】:2018-11-07 15:08:36
【问题描述】:
与正常迁移不同,这是一种不同的迁移。我已经删除了整个项目和数据库。使用了一个没有任何应用程序的基本 Django 项目。该错误始终指向我较旧的迁移。为了确保我使用了默认的 SQL lite。
导致此错误的步骤:我尝试使用 add_to_class 和 contribute_to_class 方法将列添加到组模型。在执行此操作的过程中,我忘记了迁移。
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000001E7701610D0>
Traceback (most recent call last):
File "E:\Python_365\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "E:\Python_365\lib\site-packages\django\core\management\commands\runserver.py", line 123, in inner_run
self.check_migrations()
File "E:\Python_365\lib\site-packages\django\core\management\base.py", line 427, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "E:\Python_365\lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
self.build_graph()
File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 267, in build_graph
raise exc
File "E:\Python_365\lib\site-packages\django\db\migrations\loader.py", line 241, in build_graph
self.graph.validate_consistency()
File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 243, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 243, in <listcomp>
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "E:\Python_365\lib\site-packages\django\db\migrations\graph.py", line 96, in raise_error
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0022_group_openid dependencies reference nonexistent parent node ('Task', '0003_auto_20181107_1811')
我不确定为什么 Django 仍然指的是我的迁移哪个其他项目。这也不允许我迁移我的其他项目,到处都出现相同的错误。
【问题讨论】:
标签: python django windows django-models django-migrations