Re: Duplicate entry error from syncdb
On Tue, Oct 9, 2012 at 5:50 PM, Larry Martell <larry.martell@gmail.com> wrote:
> I added a new model and then ran syncdb. It failed with:
>
> django.db.utils.IntegrityError: (1062, "Duplicate entry
> '1-add_permission' for key 'content_type_id'")
>
>
> I removed the new model and ran it again and got the same error. I've
> run syncdb many times on this same machine before with no issues.
> Anyone know what is going on here?
With the debugger I was able to see the sql that it's executing that
causing the error:
(Pdb) print sql
INSERT INTO `auth_permission` (`name`, `content_type_id`, `codename`)
VALUES (%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s,
%s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s)
(Pdb) print params
(u'Can add permission', 1, u'add_permission', u'Can change
permission', 1, u'change_permission', u'Can delete permission', 1,
u'delete_permission', u'Can add group', 2, u'add_group', u'Can change
group', 2, u'change_group', u'Can delete group', 2, u'delete_group',
u'Can add user', 3, u'add_user', u'Can change user', 3,
u'change_user', u'Can delete user', 3, u'delete_user')
Of course, those rows are already there. But why is it suddenly trying
to insert them?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home