当我努力的时候syncdb
对于我的 django 项目,我看到以下抱怨:
The following content types are stale and need to be deleted:
myapp |
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?
If you're unsure, answer 'no'.
虽然我也读过类似的问题django-syncdb-多对多-陈旧 https://stackoverflow.com/questions/5510843/django-syncdb-incorrectly-warns-that-many-to-many-field-is-stale,但我不能冒险打字yes
因为我在产品实例上。
Would yes
safely删除内容类型中那些过时的条目?
通常您可以安全地删除它们,因为这些是不再存在模型的内容类型。
您应该注意的唯一一件事是,如果您有其他模型指向ContentType
模型通过ForeignKey
这些对象也将被删除。如果您没有设置任何外键ContentType
如果您确实评估是否仍然需要具有要删除的内容类型的外键的对象(如果有的话),那么根本不会发生任何不好的事情。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)