[Django] #31176: `manage.py migrate` should wrap all migrations into a single transaction

10 views
Skip to first unread message

Django

unread,
Jan 17, 2020, 11:26:25 AM1/17/20
to django-...@googlegroups.com
#31176: `manage.py migrate` should wrap all migrations into a single transaction
-------------------------------------+-------------------------------------
Reporter: Andrew | Owner: nobody
Badr |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently, `manage.py migrate` executes each migration in turn within its
own transaction. This can break things in the following situation:
1. Attempt to deploy a change that includes multiple unapplied migrations
2. Some of the migrations get applied, then one fails (like a check
constraint)
3. Code deploy is rolled back, but database is left in an inconsistent
state.

To avoid this problem, if the user is attempting to apply a set of
migrations all at once, they should all be wrapped into a single
transaction.

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

Django

unread,
Jan 20, 2020, 2:12:56 AM1/20/20
to django-...@googlegroups.com
#31176: "manage.py migrate" should wrap all migrations into a single transaction.
-------------------------------------+-------------------------------------
Reporter: Andrew Badr | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 3.0
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* resolution: => duplicate
* component: Database layer (models, ORM) => Migrations


Comment:

Duplicate of #24535.

--
Ticket URL: <https://code.djangoproject.com/ticket/31176#comment:1>

Reply all
Reply to author
Forward
0 new messages