def METHOD_NAME(apps, schema_editor):
    DestinationConfig = apps.get_model("argus_notificationprofile", "DestinationConfig")
    Media = apps.get_model("argus_notificationprofile", "Media")
    NotificationProfile = apps.get_model("argus_notificationprofile", "NotificationProfile")
    email = Media.objects.get(slug="email")
    if (
        NotificationProfile.objects.filter(media_v1=["EM", "SM"]).exists()
        or NotificationProfile.objects.filter(media_v1=["SM"]).exists()
    ):
        try:
            sms = Media.objects.get(slug="sms")
        except Media.DoesNotExist:
            raise APIException("SMS plugin is not registered in MEDIA_PLUGINS")
    for profile in NotificationProfile.objects.all():
        if profile.user.email and profile.media_v1 in [["EM", "SM"], ["SM", "EM"], ["EM"]]:
            destination, _ = DestinationConfig.objects.get_or_create(
                user=profile.user,
                media=email,
                settings={
                    "email_address": profile.user.email,
                    "synced": True,
                },
            )
            profile.destinations.add(destination)
        if profile.phone_number and profile.media_v1 in [["EM", "SM"], ["SM", "EM"], ["SM"]]:
            destination, _ = DestinationConfig.objects.get_or_create(
                user=profile.user,
                media=sms,
                settings={
                    "phone_number": str(profile.phone_number.phone_number),
                },
            )
            profile.destinations.add(destination)