def METHOD_NAME():
    bind = op.get_bind()
    session = sa.orm.Session(bind=bind)
    for config in notifications_config:
        for event_type in config['event_types']:
            event_type_name = session.execute(f"SELECT id "  # nosec
                                              f"FROM event_type e "
                                              f"WHERE e.name = '{event_type}'")
            for event_type_id in event_type_name:
                subscriptions = session.execute(
                    f"SELECT id "  # nosec
                    f"FROM notification_subscription_config_base "
                    f"WHERE subscription_id = '{event_type_id[0]}'")
                for subscription_id in subscriptions:
                    base_config = session.execute(
                        f"SELECT id "  # nosec
                        f"FROM notification_subscription_config_base "
                        f"WHERE subscription_id = '{subscription_id[0]}'")
                    for base_config_id in base_config:
                        session.execute(f"DELETE "  # nosec
                                        f"FROM notification_subscription_websocket_config "
                                        f"WHERE id = '{base_config_id[0]}'")
                        session.execute(f"DELETE "  # nosec
                                        f"FROM notification_allowed_roles na "
                                        f"WHERE na.notification_subscription_id = '{subscription_id[0]}'")
                        session.execute(f"DELETE "  # nosec
                                        f"FROM notification_subscription_config_base "
                                        f"WHERE id = '{base_config_id[0]}'")
                    session.execute(f"DELETE "  # nosec
                                    f"FROM notification_subscription ns "
                                    f"WHERE ns.id = '{subscription_id[0]}'")
        name_list = ",".join([f"'{elem}'" for elem in config["event_types"]])
        session.execute(f'DELETE FROM event_type WHERE name IN ({name_list})')  # nosec