async def reorder_links_on_remove(
    sender: Type[ormar.Model],
    instance: ormar.Model,
    child: ormar.Model,
    relation_name: str,
    **kwargs: Any,
):
    """
    Signal receiver registered on Anima and Human models, triggered every time before
    relation on a model is removed. Note that signal functions for pre_relation_remove
    signal accepts sender class, instance, child, relation_name and have to accept
    **kwargs even if it's empty as of now.

    Note that if classes have many relations you need to check if current one is ordered
    """
    through_class = sender.ormar_config.model_fields[relation_name].through
    through_instance = getattr(instance, through_class.get_name())
    if not through_instance:
        parent_pk = instance.pk
        child_pk = child.pk
        filter_kwargs = {f"{sender.get_name()}": parent_pk, child.get_name(): child_pk}
        through_instance = await through_class.objects.get(**filter_kwargs)
    rel_one, rel_two = _get_through_model_relations(through_class, through_instance)
    await _reorder_on_update(
        sender=through_class,
        instance=through_instance,
        from_class=rel_one,
        to_class=rel_two,
        passed_args={f"{rel_one.get_name()}_order": 999999},
    )
    await _reorder_on_update(
        sender=through_class,
        instance=through_instance,
        from_class=rel_two,
        to_class=rel_one,
        passed_args={f"{rel_two.get_name()}_order": 999999},
    )

    Signal receiver registered on Anima and Human models, triggered every time before
    relation on a model is removed. Note that signal functions for pre_relation_remove
    signal accepts sender class, instance, child, relation_name and have to accept
    **kwargs even if it's empty as of now.

    Note that if classes have many relations you need to check if current one is ordered
    
tests/test_ordering/test_default_through_relation_order.py