                  "App '%s' does not have migrations (so squashmigrations on "
                  "it makes no sense)" % app_label
              )
          try:
              migration = executor.loader.get_migration_by_prefix(app_label, migration_name)
          except AmbiguityError:
              raise CommandError(
                  "More than one migration matches '%s' in app '%s'. Please be "
                  "more specific." % (migration_name, app_label)
              )
 
</s> remove         executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
        if app_label not in executor.loader.migrated_apps:
 </s> add         loader = MigrationLoader(connections[DEFAULT_DB_ALIAS])
        if app_label not in loader.migrated_apps: </s> remove             executor.loader.get_migration(al, mn)
            for al, mn in executor.loader.graph.forwards_plan((migration.app_label, migration.name))
 </s> add             loader.get_migration(al, mn)
            for al, mn in loader.graph.forwards_plan((migration.app_label, migration.name)) </s> remove from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import AmbiguityError
 </s> add from django.db.migrations.loader import AmbiguityError, MigrationLoader
            migration = loader.get_migration_by_prefix(app_label, migration_name)
                  "App '%s' does not have migrations (so squashmigrations on "
                  "it makes no sense)" % app_label
              )
          try:
            migration = loader.get_migration_by_prefix(app_label, migration_name)
          except AmbiguityError:
              raise CommandError(
                  "More than one migration matches '%s' in app '%s'. Please be "
                  "more specific." % (migration_name, app_label)
              )
keep keep keep keep replace keep keep keep keep keep
 Fixed #24703 -- Changed squashmigrations to use a MigrationLoader

Changed squashmigrations to not instantiate a MigrationExecutor,
but to directly use a MigrationLoader instance instead. 
django/core/management/commands/squashmigrations.py