#30351: Migration auth.0011_update_proxy_permissions fails for models recreated 
as
a proxy.
---------------------------------+------------------------------------
     Reporter:  Julien Enselme   |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  contrib.auth     |                  Version:  2.2
     Severity:  Release blocker  |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------
Description changed by felixxm:

Old description:

> I am trying to update my project to Django 2.2. When I launch `python
> manage.py migrate`, I get this error message when migration
> `auth.0011_update_proxy_permissions` is applying (full stacktrace is
> available [https://dpaste.de/5nJJ here]):
> `django.db.utils.IntegrityError: duplicate key value violates unique
> constraint "idx_18141_auth_permission_content_type_id_01ab375a_uniq"
> DETAIL:  Key (content_type_id, codename)=(12, add_agency) already
> exists`.
>
> It looks like the migration is trying to re-create already existing
> entries in the `auth_permission` table. At first I though it cloud
> because we recently renamed a model. But after digging and deleting the
> entries associated with the renamed model from our database in the
> `auth_permission` table, the problem still occurs with other proxy
> models.
>
> I tried to update directly from 2.0.13 and 2.1.8. The issues appeared
> each time. I also deleted my venv and recreated it without an effect.
>
> I searched for a ticket about this on the bug tracker but found nothing.
> I also posted this on [https://groups.google.com/forum/#!topic/django-
> users/KPnsJCgw8-U django-users] and was asked to report this here.

New description:

 I am trying to update my project to Django 2.2. When I launch `python
 manage.py migrate`, I get this error message when migration
 `auth.0011_update_proxy_permissions` is applying (full stacktrace is
 available [https://dpaste.de/5nJJ here]):
 `django.db.utils.IntegrityError: duplicate key value violates unique
 constraint "idx_18141_auth_permission_content_type_id_01ab375a_uniq"
 DETAIL:  Key (co.ntent_type_id, codename)=(12, add_agency) already
 exists`.

 It looks like the migration is trying to re-create already existing
 entries in the `auth_permission` table. At first I though it cloud because
 we recently renamed a model. But after digging and deleting the entries
 associated with the renamed model from our database in the
 `auth_permission` table, the problem still occurs with other proxy models.

 I tried to update directly from 2.0.13 and 2.1.8. The issues appeared each
 time. I also deleted my venv and recreated it without an effect.

 I searched for a ticket about this on the bug tracker but found nothing. I
 also posted this on [https://groups.google.com/forum/#!topic/django-
 users/KPnsJCgw8-U django-users] and was asked to report this here.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30351#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.df144d0e41627ded62f057694f899439%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to