django.db.migrations.exceptions.NodeNotFoundError: Migration apitest.0001_initial dependencies reference nonexistent parent node ('product', '0001_initial')
2024-10-20 11:55:13
执行python manage.py makemigrations时出现以下错误
D:\autotestplat>python manage.py makemigrations
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, **options)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\core\management\commands\makemigrations.py", line 78, in handle
loader = MigrationLoader(None, ignore_no_migrations=True)
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 49, in __init__
self.build_graph()
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 267, in build_graph
raise exc
File "D:\Program Files\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py", line 241, in build_graph
self.graph.validate_consistency()
File "D:\Program Files\Python\Python37-32\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 "D:\Program Files\Python\Python37-32\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 "D:\Program Files\Python\Python37-32\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 apitest.0001_initial dependencies reference nonexistent parent node ('product', '0001_initial')
问题原因:由于'product' 应用下的'0001_initial'文件不存在,而在 apitest应用下的0001_initial 文件中引用了product中的迁移记录
问题解决:删除 apitest->migrations下的0001_initial .py文件,再重新执行命令
最新文章
- iOS 保持界面流畅的技巧 (转载)
- JavaScript作用域链
- table sorting&ndash;angularjs
- Asp.net MVC验证哪些事(3)-- Remote验证及其改进(附源码)
- Python基础8- 序列
- NSCalenda日历类
- Python操作Excel
- 【php学习】图片操作
- 不区分大小写的in_array实现 thinkphp框架
- laravel5验证码
- Less2css error 终极解决方案
- AAA游戏中雪的实现
- mysql 显示表字段及mysql系统信息
- go语言简述
- mysql5.7 linux安装参考
- 初次学习AngularJS
- netbeans等宽字体却不支持中文
- Floyd算法 - 最短路径
- Spark JavaRDD、JavaPairRDD、Dataset之间的相互转换
- [PowerShell]get data from Ini File
热门文章
- InnoDB关于事务、锁、MVCC专题
- 【YOLOv5】LabVIEW+YOLOv5快速实现实时物体识别(Object Detection)含源码
- 「JOISC 2022 Day1」京都观光 题解
- Flink WordCount入门
- MyBatis的各种查询功能
- 成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
- JMETER与它的组件们
- RDF/RDFS/OWL
- 带你了解NLP的词嵌入
- Codeforces Round #817 (Div. 4)