stale content types while syncdb in Django
Asked Answered
I

1

13

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?

Insnare answered 23/5, 2013 at 3:36 Comment(0)
L
15

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

Legroom answered 23/5, 2013 at 7:50 Comment(2)
thanks. ForeignKey matters indeed. I think I'll have to verify after syncdb to ensure the security.Insnare
I have a problem: each time I run "migrate", it asks for it, even if I dont touch anything.Preterit

© 2022 - 2024 — McMap. All rights reserved.