Re: [Django] #33744: sqlmigrate wraps it's output in BEGIN/COMMIT even if atomic transactions are disabled (was: sqlmigrate wraps it's outpout in BEGIN/COMMIT even if atomic transactions are disabled)

3 views
Skip to first unread message

Django

unread,
May 26, 2022, 12:56:21 AM5/26/22
to django-...@googlegroups.com
#33744: sqlmigrate wraps it's output in BEGIN/COMMIT even if atomic transactions
are disabled
-------------------------------------+-------------------------------------
Reporter: Joe Meissler | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 4.0
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Simon Charette (added)
* status: new => closed
* type: Bug => Cleanup/optimization
* resolution: => needsinfo


Comment:

Replying to [ticket:33744 Joe Meissler]:
> It does not, however, consider if the schema editor is
[https://github.com/django/django/blob/7119f40c9881666b6f9b5cf7df09ee1d21cc8344/django/db/backends/base/schema.py#L143
using an atomic migration].
>
> `sqlmigrate` can be updated to use `migration.atomic and
schema_editor.atomic_migration` instead of `migration.atomic and
connection.features.can_rollback_ddl`.

Schema editor instance is created later in `MigrationLoader` (it isn't
available in `sqlmigrate`'s `handle()`) and its `atomic` value is based on
`migration.atomic`. I'm not sure when these two flags might have different
values. Can you provide an example? How you would like to introduce
`SchemaEditor` in the `sqlmigrate`?

--
Ticket URL: <https://code.djangoproject.com/ticket/33744#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages