#34009: migrations.RunPython runs queries against wrong database
--------------------------------+--------------------------------------
Reporter: Marcel Moreaux | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by Marcel Moreaux):
Ah, I see, I missed that.
That's still very unfortunate behaviour though; it means `RunPython`
methods should be littered with explicit `.using()` clauses to ensure they
actually use the DB specified in `schema_editor.connection.alias`. Miss
one, and it may inadvertently wreak havoc on the default database... (as
was happening in our project)
--
Ticket URL: <https://code.djangoproject.com/ticket/34009#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/010701834095539c-ddc4eeac-3ef3-482e-b4e1-11bbd6bac375-000000%40eu-central-1.amazonses.com.