Opened 9 years ago

Closed 9 years ago

#24755 closed Bug (fixed)

makemigrations --merge output is confusing when one head depends on another app

Reported by: Carl Meyer Owned by: Markus Holtermann
Component: Migrations Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When you run makemigrations --merge, for every app with multiple 'head' migrations, makemigrations lists each head and the operations present only in its branch. So for instance, if we have an app X which has migrations X.0003_a and X.0003_b, both of which depend on X.0002, then makemigrations --merge will list the operations present in each of the two migrations X.0003_a and X.0003_b so we can verify that they don't conflict. So far, so good.

However, let's say we have another app Y, with migrations up to Y.0004, and it so happens that X.0003_b depends on Y.0004 (in addition to depending on X.0002).

In this situation, makemigrations --merge includes every operation in every migration of app Y in its list of operations that are part of the X.0003_b branch. This is very confusing, as it makes that branch appear much bigger than it actually is. Despite the dependency, the migrations in app Y are not relevant to determining whether the merge is safe, because in general it is an assumption of the migrations framework that migrations in different apps do not conflict with one another (which is we allow one "head" migration per app, not per project).

I think that makemigrations --merge should restrict its search for operations in each branch to the current app only, and not display operations from a different app.

Change History (5)

comment:1 by Carl Meyer, 9 years ago

Summary: makemigrations --merge output is confusing when one head has a dependency to another appmakemigrations --merge output is confusing when one head depends on another app

comment:2 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Markus Holtermann, 9 years ago

Has patch: set
Owner: changed from nobody to Markus Holtermann
Status: newassigned

comment:4 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Markus Holtermann <info@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 0271a11:

Fixed #24755 -- Hid operations from dependency apps when merging migrations

Thanks Carl Meyer for the report and Tim Graham for the review.

Note: See TracTickets for help on using tickets.
Back to Top