Opened 5 years ago
Closed 5 years ago
#31176 closed Cleanup/optimization (duplicate)
"manage.py migrate" should wrap all migrations into a single transaction.
Reported by: | Andrew Badr | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 3.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently, manage.py migrate
executes each migration in turn within its own transaction. This can break things in the following situation:
- Attempt to deploy a change that includes multiple unapplied migrations
- Some of the migrations get applied, then one fails (like a check constraint)
- 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.
Change History (1)
comment:1 by , 5 years ago
Component: | Database layer (models, ORM) → Migrations |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | `manage.py migrate` should wrap all migrations into a single transaction → "manage.py migrate" should wrap all migrations into a single transaction. |
Note:
See TracTickets
for help on using tickets.
Duplicate of #24535.