当我试图为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
会删除内容类型中那些陈旧的条目吗?
发布于 2013-05-22 23:50:13
通常,您可以安全地删除它们,因为这些是不再存在模型的内容类型。唯一需要注意的是,如果有其他模型通过ContentType
指向ForeignKey
模型,那么这些对象也将被删除。如果您根本没有将任何外键设置为ContentType
,那么任何坏的事情都不会发生,如果您仍然需要具有要删除的内容类型的外键的对象(如果有外键的话)。
https://stackoverflow.com/questions/16705249
复制