--
Ticket URL: <https://code.djangoproject.com/ticket/31383>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "31383.diff" added.
draft patch
Comment (by Tim Graham):
The draft patch seems to work except for "Executing DDL statements while
in a transaction on databases that can't perform a rollback is
prohibited." (from 813805833aca60544f6b3d686c015039f6af5d1d) when running
in non-dry-run mode.
--
Ticket URL: <https://code.djangoproject.com/ticket/31383#comment:1>
* stage: Unreviewed => Accepted
Comment:
It's a shame that the schema editor cannot operate on model states and
requires the creation of a temporary model here.
You'll want to use a throw away `apps` instead of a `dummy` app name,
here's how the schema recorder does it
In order to address `Executing DDL statements while in a transaction on
databases that can't perform a rollback is prohibited.` you should remove
the outer `atomic` block and let `SchemaEditor`
[https://github.com/django/django/blob/c1c361677d9400c8e2cdaddda0c16086bb358492/django/db/backends/base/schema.py#L101
handle it] if it's allowed by the underlying backend.
--
Ticket URL: <https://code.djangoproject.com/ticket/31383#comment:2>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/12590 PR] (tests not passing yet)
--
Ticket URL: <https://code.djangoproject.com/ticket/31383#comment:3>