Opened 7 months ago

Closed 3 months ago

Last modified 3 months ago

#23359 closed New feature (fixed)

Add ability to show the migration plan

Reported by: Markush2010 Owned by: MarkusH
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Markush2010 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

The migrate command already allows one to list all the migrations and their status (applied / not applied) grouped and sorted by app name. Similar to this it would be nice to show the migration plan, i.e. which migration is applied when.

Change History (13)

comment:1 Changed 7 months ago by Markush2010

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to Markush2010
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 7 months ago by Markush2010

  • Has patch set

comment:3 Changed 7 months ago by timgraham

  • Easy pickings unset
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 7 months ago by Markush2010

As shortly discussed with jax on IRC, having the --list output as part of migrate is somewhat inconsistent. I'd rather add another command showmigrations that offers --list (what manage.py migrate --list is doing right now) as a default and --plan with the this output (dependencies are only shown for --verbose 2). We could add a --graph option too that outputs the content for a dotfile, as shown in the pull request.

comment:5 Changed 7 months ago by Markush2010

  • Cc Markush2010 added

comment:6 Changed 7 months ago by Markush2010

  • Needs documentation set

I added another PR (https://github.com/django/django/pull/3153) that adds a dedicated showmigrations command which then also takes care of --list from the migrate command.

comment:7 Changed 4 months ago by MarkusH

  • Owner changed from Markush2010 to MarkusH

comment:8 Changed 3 months ago by MarkusH

  • Needs documentation unset

comment:9 Changed 3 months ago by timgraham

  • Patch needs improvement set

comment:10 Changed 3 months ago by MarkusH

  • Patch needs improvement unset

comment:11 Changed 3 months ago by timgraham

  • Triage Stage changed from Accepted to Ready for checkin

comment:12 Changed 3 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In a1487deebff7bf27a4946a9f5ddd68154fa4834d:

Fixed #23359 -- Added showmigrations command to list migrations and plan.

Thanks to Collin Anderson, Tim Graham, Gabe Jackson, and Marc Tamlyn
for their input, ideas, and review.

comment:13 Changed 3 months ago by Tim Graham <timograham@…>

In e08318b4ef25cfe7d1cfbc5ae7d134ee477506ba:

Refs #23359 -- Removed double newline from output of migrate --list

Thanks Berker Peksag for the review.

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