def reverse(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) -> None:
    """
    Set the values for the OrganisationSubscriptionInformationCache objects back to 1 (which
    is incorrect for paid subscriptions, but necessary to avoid IntegrityError when reversing
    migrations)
    """

    organisation_subscription_information_cache_model = apps.get_model(
        "organisations", "organisationsubscriptioninformationcache"
    )
    organisation_subscription_information_cache_model.objects.exclude(
        organisation__subscription__plan="free"
    ).update(allowed_projects=1)

    Set the values for the OrganisationSubscriptionInformationCache objects back to 1 (which
    is incorrect for paid subscriptions, but necessary to avoid IntegrityError when reversing
    migrations)
    
api/organisations/migrations/0046_allow_allowed_projects_to_be_null.py