def METHOD_NAME(apps, schema_editor):
    TaskLog = apps.get_model("cm", "TaskLog")
    _models = {
        "adcm": (apps.get_model("cm", "ADCM"), "name"),
        "cluster": (apps.get_model("cm", "Cluster"), "name"),
        "service": (apps.get_model("cm", "ClusterObject"), "display_name"),
        "component": (apps.get_model("cm", "ServiceComponent"), "display_name"),
        "provider": (apps.get_model("cm", "HostProvider"), "name"),
        "host": (apps.get_model("cm", "Host"), "fqdn"),
    }
    for task in TaskLog.objects.all():
        if task.selector:
            selector = _fix_selector(task.selector, _models)
        else:
            if not task.object_type:
                continue
            model, _ = _models.get(MODEL_TYPE[task.object_type.model], (None, None))
            if not model:
                continue
            obj = model.objects.filter(pk=task.object_id).first()
            if not obj:
                continue
            selector = {}
            if obj.prototype.type in {"adcm", "cluster", "provider"}:
                selector[obj.prototype.type] = {"id": obj.pk, "name": obj.name}
            elif obj.prototype.type == "service":
                selector["cluster"] = {"id": obj.cluster.pk, "name": obj.cluster.name}
                selector["service"] = {"id": obj.pk, "name": obj.prototype.display_name}
            elif obj.prototype.type == "component":
                selector["cluster"] = {"id": obj.cluster.pk, "name": obj.cluster.name}
                selector["service"] = {
                    "id": obj.service.pk,
                    "name": obj.service.prototype.display_name,
                }
                selector["component"] = {"id": obj.pk, "name": obj.prototype.display_name}
            elif obj.prototype.type == "host":
                selector["host"] = {"id": obj.pk, "name": obj.fqdn}
                if task.action and task.action.host_action:
                    context = _get_host_action_context(apps, obj, task)
                    selector.update(context)
                else:
                    selector["provider"] = {
                        "id": obj.provider.pk,
                        "name": obj.provider.name,
                    }
        task.selector = selector
        task.save(update_fields=["selector"])
        task.joblog_set.filter().update(selector=selector)