#30351: Migration auth.0011_update_proxy_permissions fails for models recreated
as
a proxy.
---------------------------------+--------------------------------------
Reporter: Julien Enselme | Owner: Arthur Rio
Type: Bug | Status: assigned
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
---------------------------------+--------------------------------------
Comment (by B Martsberger):
It's also possible to get this kind of integrity error on the auth.0011
migration if another app is migrated first causing the auth
post_migrations hook to run. The auth post migrations hook runs
`django.contrib.auth.management.create_permissions`, which writes the new
form of the auth_permission records to the table. Then when the auth.0011
migration runs it tries to update things to the values that were just
written.
To reproduce this behavior:
1. pip install Django==2.1.7
2. Create an app, let's call it `app`, with two models,
`TestModel(models.Model)` and `ProxyModel(TestModel)` the second one with
proxy=True
3. `python manage.py makemigrations`
4. `python manage.py migrate`
5. pip install Django==2.2
6. Add another model to `app`
7. `python manage.py makemigrations`
8. migrate the app only, `python manage.py migrate app`. This does not run
the auth migrations, but does run the auth post_migrations hook
9. Note that new records have been added to auth_permission
10. `python manage.py migrate`, this causes an integrity error when the
auth.0011 migration tries to update records that are the same as the ones
already added in step 8.
This has the same exception as this bug report, I don't know if it's
considered a different bug, or the same one.
--
Ticket URL: <https://code.djangoproject.com/ticket/30351#comment:7>
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.46bb31e7c682d4167122d7511b13830e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.