﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29198	Add a --plan option to the migrate command	Craig de Stigter	Calvin DeBoer	"While migrating a prod database today I found myself feeling uncomfortable.

In a situation like this:

{{{
[X] 0023_add_fairy_dust
[X] 0021_apply_beers_to_database
[ ] 0022_magik_stuff
[ ] 0024_merge
}}}

... what will happen when I run `django-admin migrate app 0023_add_fairy_dust`? Will `0021_apply_beers_to_database` get unapplied? Will it try to roll forwards to the merge? Will some dependencies from another app get pulled in? Will any tables get dropped? Something Else?*

We really need a way to quickly sanity-check what's going to happen, before actually doing it. 

A dry-run option was proposed in #23347 but then everyone missed the forest for the trees, and it was closed because something about RunPython not being able to be sqlified.

There are various ways to do this:

* I think a simple `--plan` showing which migrations will be applied (same as the `showmigrations` option, but for a specific plan, especially for reverse plans) would probably be enough to ease my mind about unapplying beers.
* A short summary of the operations involved might be nice.
* Full SQL output might be cool. But it might also be too verbose for a quick sanity check if there are a lot of changes. And as pointed out in the other ticket, it doesn't work for RunPython (but that's not really a good reason to not do it)


I haven't spent much time in newer releases (currently upgrading a large project from 1.8 to 1.11) but AFAICT this still doesn't exist. Correct me if I'm wrong.




(*Answer: nothing happens - it says `No migrations to apply.`. I don't think it's possible to unapply those beers, but that's a separate issue.)"	New feature	closed	Migrations	dev	Normal	fixed		Calvin DeBoer	Accepted	1	0	0	1	0	0
