﻿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
34866	Cannot inspect migrations that replace squashed migrations with sqlmigrate	Giovanni Allegri	Sandeep Pal	"Commit https://github.com/django/django/commit/d88365708c554efe3c786c3be6da1d9de916360f forces MigrationLoader with replace_migrations=False. This is fine to inspect squashed migrations, as requested in https://code.djangoproject.com/ticket/31318. 

However, in case the squashed migrations remove a model or a field, the command breaks when it reaches the migration that replaces the squashed migrations. since this will try to modify a model that was already removed (by the squashed migrations).

I propose to make the replace_migrations controllable with a parameter to sqlmigrate. If not set the option will be False (as it is now by default). The following command would make sqlmigrate replace squashed migrations:


{{{
django-admin sqlmigrate --replace-migrations ...
}}}




"	Bug	closed	Migrations	4.2	Normal	needsinfo		David Wobrock	Unreviewed	0	0	0	0	0	0
