gpt4 book ai didi

django - 删除陈旧的ContentTypes的最干净方法?

转载 作者:行者123 更新时间:2023-12-03 13:45:16 24 4
gpt4 key购买 nike

我想摆脱在运行迁移时收到的以下消息:

The following content types are stale and need to be deleted:

appname | modelname

Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?

在迁移中对删除或不删除的决定进行编码似乎更干净。

在迁移过程中,检测和删除陈旧的ContentType的最干净方法是什么?如果ContentTypes为 created automatically,为什么不自动完成?

最佳答案

尝试此操作以安全删除

python manage.py remove_stale_contenttypes
该命令可用> Django 1.11

关于django - 删除陈旧的ContentTypes的最干净方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39256095/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com