'''Problem:'''
Running a RunPython migration on the second database fails since it still
operates on the default database.
{{{
python manage.py migrate --database=seconddb
}}}
Except the hacky way, reading the sys.argv, there is no way to determine
the current db to act upon that db.
'''Solution:'''
Add a parameter (or extend an existing) to include a variable "database"
which contains the current db.
{{{apps.get_model}}} should be able to get the schema for a specific db.
--
Ticket URL: <https://code.djangoproject.com/ticket/26529>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
Use `schema_editor.connection.alias` to find the specified database as
documented in the [https://docs.djangoproject.com/en/stable/ref/migration-
operations/#runpython RunPython reference].
--
Ticket URL: <https://code.djangoproject.com/ticket/26529#comment:1>
Comment (by ktugan):
My humblest apology for asking prematurely!
--
Ticket URL: <https://code.djangoproject.com/ticket/26529#comment:2>