stale content types while syncdb in Django

拟墨画扇 提交于 2020-01-12 04:32:46

问题


While I'm trying to syncdb for my django project, I'm seeing following complains:

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'.

While I've also read the similar problem django-syncdb-many-to-many-stale, but I cannot risk myself typing yes since I'm on prod instance.

Would yes safely delete those stale entries in contenttype?


回答1:


Normally you can delete them safely, as these are content types where no model exists anymore. The only thing you should be aware of is, that if you had other models pointing to the ContentType model via a ForeignKey these objects will be deleted as well. If you didn't set any foreign keys to ContentType at all nothing bad can happen, if you did evaluate if you would still need the objects that have a foreign key to the content type you are about to delete (if there are any).



来源:https://stackoverflow.com/questions/16705249/stale-content-types-while-syncdb-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!