Opened 4 years ago

Last modified 4 years ago

#31021 closed Bug

migration doesn't work on multi database environment — at Initial Version

Reported by: haudoing Owned by: nobody
Component: contrib.auth Version: 2.2
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The tutorial said that we can omit to set the default database if default doesn't makes sense
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/#defining-your-databases

But the following script brake it
https://github.com/django/django/blob/stable/2.2.x/django/contrib/auth/migrations/0011_update_proxy_permissions.py

on line 42, it use

            with transaction.atomic():
                Permission.objects.filter(
                    permissions_query,
                    content_type=old_content_type,
                ).update(content_type=new_content_type)

This will brake the migration if default database doesn't set

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top