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.
This commit is contained in:
Markus Holtermann 2014-09-03 10:51:07 +02:00 committed by Tim Graham
parent 8952757698
commit a1487deebf
7 changed files with 314 additions and 57 deletions

View file

@ -770,15 +770,10 @@ be warned that using ``--fake`` runs the risk of putting the migration state
table into a state where manual recovery will be needed to make migrations
run correctly.
.. django-admin-option:: --list, -l
The ``--list`` option will list all of the apps Django knows about, the
migrations available for each app and if they are applied or not (marked by
an ``[X]`` next to the migration name).
Apps without migrations are also included in the list, but will have
``(no migrations)`` printed under them.
.. deprecated:: 1.8
The ``--list`` option has been moved to the :djadmin:`showmigrations`
command.
runfcgi [options]
-----------------
@ -1088,6 +1083,32 @@ behavior you can use the ``--no-startup`` option. e.g.::
django-admin shell --plain --no-startup
showmigrations [<app_label> [<app_label>]]
------------------------------------------
.. django-admin:: showmigrations
.. versionadded:: 1.8
Shows all migrations in a project.
.. django-admin-option:: --list, -l
The ``--list`` option lists all of the apps Django knows about, the
migrations available for each app, and whether or not each migrations is
applied (marked by an ``[X]`` next to the migration name).
Apps without migrations are also listed, but have ``(no migrations)`` printed
under them.
.. django-admin-option:: --plan, -p
The ``--plan`` option shows the migration plan Django will follow to apply
migrations. Any supplied app labels are ignored because the plan might go
beyond those apps. Same as ``--list``, applied migrations are marked by an
``[X]``. For a verbosity of 2 and above, all dependencies of a migration will
also be shown.
sql <app_label app_label ...>
-----------------------------