Django 1.8,如何完全重置迁移?

2024-04-29 16:15:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我想完全重置迁移和数据库。在

如何删除“auth”app的迁移文件。在

如果我键入任何与migrate相关的命令,将发生以下错误:

django.db.migrations.graph.NodeNotFoundError: Migration auth.0007_user_lend_to dependencies reference nonexistent parent node ('account', '0007_deal_is_completed')


Tags: 文件django命令auth数据库appdb键入
1条回答
网友
1楼 · 发布于 2024-04-29 16:15:14

如果您想从先抓挠重新创建数据库。那么在

find . -path *migrations* -name "*.py" -not -path "*__init__*" -exec rm {} \; # make sure to be in your projects path
python manage.py makemigrations
python manage.py migrate

相关问题 更多 >