Over the course of a year or two of manual database twiddling, I've
fairly well messed up my table indexes and whatnot. In particular, I'm
getting lots of "duplicate key names" when installing fixtures for
testing, and generic foreign keys that point at contenttypes that no
longer exist.
I've started with my custom comment app, and I have some questions
about how this works:
1. If I'm using BaseCommentAbstractModel only, should I expect syncdb
to create django_comments and django_comment_flags tables?
2. Is it possible to have a custom comment model that's just called
Comment?
3. The comments app is one of the ones where indexes can't be created
because of duplicate key names. I tried the trick of renaming my
custom comment table in the database, and then running syncdb to
create an empty "proper" table, planning to move the data into the new
table after. The syncdb output looks like this (I named the custom
comment model MyComment):
Creating table django_comments
Creating table django_comment_flags
Creating table comments_mycomment
Installing index for comments.Comment model
Installing index for comments.CommentFlag model
Installing index for comments.MyComment model
Installing index for comments.Comment model
Failed to install index for comments.Comment model: (1061, "Duplicate
key name 'django_comments_content_type_id'")
Installing index for comments.CommentFlag model
Failed to install index for comments.CommentFlag model: (1061,
"Duplicate key name 'django_comment_flags_user_id'")
Installing index for comments.MyComment model
Failed to install index for comments.MyComment model: (1061,
"Duplicate key name 'comments_mycomment_content_type_id'")
So it looks like the python models Comment and CommentFlag are being
created "inside" my custom app, though the tables are still labeled
"django_XXX". Presumably that's how it's supposed to work, but how do
I get rid of my index failures?
Thanks!
Eric
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.