Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27432 closed New feature (fixed)

showmigrations --plan should show migrations that would be applied for the given app_labels

Reported by: Will Hardy Owned by: Tim Graham <timograham@…>
Component: Core (Management commands) Version: dev
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

If you call showmigrations with --plan, any app_labels that are also applied are ignored. But if you run migrate with a given app_label, a plan is followed that only applies migrations for the given app, and any dependencies that were found along the way.

Instead of ignoring any supplied app_labels, it would make more sense to behave as migrate does, providing a preview for a probable migration plan.

Change History (10)

comment:1 by Sebastian Spiegel, 8 years ago

Owner: changed from nobody to Sebastian Spiegel
Status: newassigned

comment:2 by Sebastian Spiegel, 8 years ago

Component: UncategorizedCore (Management commands)
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

Though documentation is explaining why --plan is ignoring app_labels:

Any supplied app labels are ignored because the plan might go beyond those apps.

(https://docs.djangoproject.com/en/1.10/ref/django-admin/#django-admin-showmigrations)

I agree with the reporter that showmigrations --plan should support app labels. It would make it behave analogously to migrate app_label.

comment:3 by Sebastian Spiegel, 8 years ago

Has patch: set

PR ready, all tests pass under SQLite.

comment:4 by Markus Holtermann, 8 years ago

Patch needs improvement: set
Version: 1.10master

comment:5 by Sebastian Spiegel, 8 years ago

Patch needs improvement: unset

comment:6 by Sebastian Spiegel, 8 years ago

I've pushed requested improvements to the PR

comment:7 by Sebastian Spiegel, 8 years ago

Owner: Sebastian Spiegel removed
Status: assignednew

comment:8 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:9 by Tim Graham <timograham@…>, 8 years ago

Owner: set to Tim Graham <timograham@…>
Resolution: fixed
Status: newclosed

In 8b734d2f:

Fixed #27432 -- Made app_label arguments limit showmigrations --plan output.

comment:10 by Tim Graham <timograham@…>, 8 years ago

In 9932e1bf:

Fixed test isolation in a couple migrations tests.

Without this, tests from refs #27432 fail when running with --reverse.

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