def METHOD_NAME(apps, schema_editor):
    App = apps.get_model("app", "App")
    PluginConfiguration = apps.get_model("plugins", "PluginConfiguration")
    TaxConfiguration = apps.get_model("tax", "TaxConfiguration")
    def _get_tax_app():
        permissions = {}
        permissions["permissions__content_type__app_label"] = "checkout"
        permissions["permissions__codename"] = "handle_taxes"
        return App.objects.filter(
            is_active=True,
            webhooks__is_active=True,
            webhooks__events__event_type__in=[
                CHECKOUT_CALCULATE_TAXES,
                ORDER_CALCULATE_TAXES,
            ],
            **permissions,
        )
    # If there is any tax app enabled, turn on TAX_APP strategy for all channels.
    is_tax_app_enabled = _get_tax_app().exists()
    if is_tax_app_enabled:
        TaxConfiguration.objects.update(
            tax_calculation_strategy=TaxCalculationStrategy.TAX_APP
        )
        return
    # Set TAX_APP calculation strategy for the channels where Avalara is configured.
    # Set FLAT_RATES tax calculation strategy for channels where Vatlayer is enabled.
    avatax_configs = PluginConfiguration.objects.filter(
        active=True, identifier=AVATAX_PLUGIN_ID
    )
    avatax_tax_configs = []
    for config in avatax_configs:
        config_dict = {item["name"]: item["value"] for item in config.configuration}
        tc = config.channel.tax_configuration
        tc.tax_calculation_strategy = TaxCalculationStrategy.TAX_APP
        override_global_tax = config_dict.get("override_global_tax")
        # There might be a situation that the value is a string `true` or `false`,
        # so we need to handle such situation too
        if override_global_tax is True or override_global_tax == "true":
            include_taxes_in_prices = config_dict.get("include_taxes_in_prices")
            if include_taxes_in_prices is not None:
                tc.prices_entered_with_tax = (
                    include_taxes_in_prices
                    if isinstance(include_taxes_in_prices, bool)
                    else include_taxes_in_prices.lower() == "true"
                )
        avatax_tax_configs.append(tc)
    TaxConfiguration.objects.bulk_update(
        avatax_tax_configs, ["prices_entered_with_tax", "tax_calculation_strategy"]
    )
    vatlayer_channels = PluginConfiguration.objects.filter(
        active=True, identifier=VATLAYER_ID
    ).values_list("channel_id", flat=True)
    TaxConfiguration.objects.filter(channel_id__in=vatlayer_channels).update(
        tax_calculation_strategy=TaxCalculationStrategy.FLAT_RATES
    )