当我试图为我的django项目syncdb
时,我看到了以下抱怨:
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-many-to-many-stale,但我不能冒险输入yes
,因为我在prod实例上。
yes
是否可以安全地删除contenttype中那些过时的条目?
通常,您可以安全地删除它们,因为它们是不再存在模型的内容类型。 唯一需要注意的是,如果有其他模型通过
ForeignKey
指向ContentType
模型,那么这些对象也将被删除。如果您没有将任何外键设置为ContentType
,则不会发生任何不好的情况,如果您确实计算了是否仍然需要将要删除的内容类型(如果有)具有外键的对象。相关问题 更多 >
编程相关推荐