def METHOD_NAME(apps, schema_editor):
    ExtraPackageTypeStorage = apps.get_model("subscription", "ExtraPackageTypeStorage")
    packages = ExtraPackageTypeStorage.objects.filter(
        code__in=("storage", "storage_medium"),
    )
    if packages.count() == 1:
        packages.update(
            code="storage_medium",
            display_name="Medium +1000MB",
            is_public=True,
            megabytes=1000,
        )
    else:
        ExtraPackageTypeStorage.objects.all().delete()
        ExtraPackageTypeStorage.objects.create(
            code="storage_medium",
            display_name="Medium +1000MB",
            is_public=True,
            megabytes=1000,
        )