Better Indication of Squash Migration State in showmigrations
|Reported by:||Mark Lavin||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In the discussion of #25231 (https://github.com/django/django/pull/5112) it became clear that there was a disconnect between the current output of
showmigrations and the actual recorded applied state of squashed migrations.
Currently if all of the replaced/original migrations have been run,
showmigrations will output that the related squashed migration has been applied with an [X] in the output even if that has not yet been recorded by the migration recorder. However, it is currently a requirement that
migrate be run to record this applied state for the squashed migration before the original migrations are removed. If a deployment process is looking for an empty [ ] to know to run the migration then this may trip it up.
This case is to consider an output for
showmigrations which can indicate that this migration has only been "soft" applied, that is applied but not recorded yet.
Changes to the planner for such an output may also impact #24900.