#31021: migration doesn't work on multi database environment.
------------------------------+--------------------------------------
Reporter: haudoing | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Description changed by haudoing:
Old 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 migration script doesn't work after configuration with
> empty default database
> 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)
> }}}
>
> Tracebacks
> {{{
> raise ImproperlyConfigured("settings.DATABASES is improperly
> configured. "
> django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
> improperly configured. Please supply the ENGINE value. Check settings
> documentation for more details.
> }}}
>
>
> This will brake the migration if default database doesn't set
New 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 migration script doesn't work after configuration with
empty default database
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
Tracebacks
{{{
raise ImproperlyConfigured("settings.DATABASES is improperly
configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
improperly configured. Please supply the ENGINE value. Check settings
documentation for more details.
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31021#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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.ab777e0577031ffacfc45d6de79a93a5%40djangoproject.com.