﻿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
32267	Unable to unapply a branch of migrations	Roman Odaisky	nobody	"1. Check out the master branch of a project into a new branch
2. Implement a feature
3. Make migrations
4. Apply the migrations
5. Merge updates from master into current branch
6. makemigrations --merge
7. Possibly repeat items 2–6 several times
8. Decide to abandon the feature, look for a way to restore the DB to what the code in master expects

However, there’s no invocation of `manage.py migrate` that will unapply all the migrations introduced by one branch.

For example:
{{{
master ...---0050---0051a---0052a
                 \               \
feature           0051b---0052b---0053m
}}}
We’re currently at the merge migration 0053m. We’d like to mark 0053m as unapplied, perform the rollback operations of 0052b and 0051b and end up at 0052a (at which point we can check out master and forget about the existence of the abandoned branch and its migrations). Currently this is only possible (other than rolling back and re-applying the master migrations, which may not even be an option) by doing a number of `--fake` migrations in a risk-prone manner.

There needs to be an option to run `manage.py migrate --before myapp 0051b` or something like that, a command that would rollback the specified migration and all others that depend on it but leaving ones from parallel branches unaffected. In other words, while `manage.py migrate myapp 1234` ensures that 1234 is applied, the suggested command would ensure that the specified migration is //not// applied (unapplying other migrations where necessary, but as few as possible)."	New feature	closed	Migrations	3.1	Normal	wontfix			Unreviewed	0	0	0	0	0	0
