def METHOD_NAME():
    # get existing table metadata
    conn = op.get_bind()
    meta = sa.MetaData()
    meta.reflect(bind=conn, only=("allowlists",))
    allowlists = meta.tables["allowlists"]
    results = conn.execute(sa.text("SELECT id, ima_policy FROM allowlists")).fetchall()
    # Update allowlist entries with converted IMA policies
    for old_ima_policy_id, old_ima_policy in results:
        try:
            old_ima_policy = json.loads(old_ima_policy)
        except Exception as e:
            message = "Error loading JSON-formatted Keylime policy: %s", repr(e)
            logger.error(message)
            raise e
        alist_json = old_ima_policy["allowlist"]
        new_ima_policy = copy.deepcopy(ima.EMPTY_RUNTIME_POLICY)
        new_ima_policy["meta"]["timestamp"] = str(datetime.datetime.now())
        new_ima_policy["meta"]["generator"] = ima.RUNTIME_POLICY_GENERATOR.LegacyAllowList
        for key in new_ima_policy.keys():
            if key == "digests":
                digests = alist_json.get("hashes")
                if not digests:
                    message = "Allowlist %s does not have a valid hash list!", old_ima_policy_id
                    logger.error(message)
                    raise Exception(message)
                new_ima_policy[key] = alist_json["hashes"]
            elif key == "excludes":
                new_ima_policy["excludes"] = old_ima_policy["exclude"]
            elif key == "meta":
                # Skip old metadata
                continue
            else:
                to_migrate = alist_json.get(key, None)
                if to_migrate is None:
                    logger.info("Runtime policy field '%s' not found in existing allowlist; using default value", key)
                else:
                    new_ima_policy[key] = alist_json[key]
        new_ima_policy = json.dumps(new_ima_policy)
        conn.execute(allowlists.update().where(allowlists.c.id == old_ima_policy_id).values(ima_policy=new_ima_policy))