yuw*_*ang 13 python django syncdb contenttypes
当我正在尝试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'.
Run Code Online (Sandbox Code Playgroud)
虽然我也读过类似的问题django-syncdb-many-to-many-stale,但是yes因为我在prod实例上,所以我不能冒险打字.
可以yes 安全地删除contenttype中的那些陈旧条目吗?
Ber*_*ant 15
通常您可以安全地删除它们,因为这些是不再存在模型的内容类型.您应该注意的唯一事情是,如果您ContentType通过ForeignKey这些对象指向模型的其他模型也将被删除.如果您没有设置任何外键,ContentType则不会发生任何不良情况,如果您确实评估是否仍然需要具有您要删除的内容类型的外键的对象(如果有的话).
| 归档时间: |
|
| 查看次数: |
7598 次 |
| 最近记录: |