def METHOD_NAME(apps, schema_editor):
    NumericFilter = apps.get_model("metering_billing", "NumericFilter")
    Metric = apps.get_model("metering_billing", "Metric")
    for m in Metric.objects.all():
        m2m = list(m.numeric_filters.all())
        m.numeric_filters.clear()
        for nf in m2m:
            nf, _ = NumericFilter.objects.get_or_create(
                organization=m.organization,
                property_name=nf.property_name,
                operator=nf.operator,
                comparison_value=nf.comparison_value,
            )
            m.numeric_filters.add(nf)
    NumericFilter.objects.filter(organization__isnull=True).delete()