def METHOD_NAME(apps, schema_editor):
    QuerySubscription = apps.get_model("sentry", "QuerySubscription")
    for subscription in RangeQuerySetWrapperWithProgressBar(
        QuerySubscription.objects.filter(snuba_query__dataset=Dataset.Metrics.value).select_related(
            "snuba_query"
        )
    ):
        old_subscription_id = subscription.subscription_id
        if old_subscription_id is not None:
            try:
                # The migration apps don't build this property, so patch it here:
                subscription.snuba_query.event_types = event_types
                create_subscription_in_snuba(subscription)
                delete_subscription_from_snuba(subscription, Dataset.Metrics)
            except Exception:
                logging.exception(
                    "Failed to recreate metrics subscription in snuba",
                    extra={
                        "project": subscription.project.slug,
                        "subscription_id": subscription.id,
                        "query": subscription.snuba_query.query,
                        "aggregate": subscription.snuba_query.aggregate,
                        "time_window": subscription.snuba_query.time_window,
                        "resolution": subscription.snuba_query.resolution,
                    },
                )