﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30351	Migration auth.0011_update_proxy_permissions fails for models recreated as a proxy.	Julien Enselme	nobody	"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."	Bug	new	contrib.auth	2.2	Release blocker			Simon Charette Arthur Rio Antoine Catton	Accepted	0	0	0	0	0	0
