def METHOD_NAME(
    object: sqlalchemy.schema.SchemaItem,
    name: str,
    type_: str,
    reflected: bool,
    compare_to: sqlalchemy.schema.SchemaItem,
) -> bool:
    """
    Determines whether or not alembic should include an object when autogenerating
    database migrations.
    Args:
        object: a sqlalchemy.schema.SchemaItem object such as a
            sqlalchemy.schema.Table, sqlalchemy.schema.Column,
            sqlalchemy.schema.Index sqlalchemy.schema.UniqueConstraint, or
            sqlalchemy.schema.ForeignKeyConstraint object.
        name: the name of the object. This is typically available via object.name.
        type: a string describing the type of object; currently "table", "column",
            "index", "unique_constraint", or "foreign_key_constraint"
        reflected: True if the given object was produced based on table reflection,
            False if it's from a local .MetaData object.
        compare_to: the object being compared against, if available, else None.
    Returns:
        bool: whether or not the specified object should be included in autogenerated
            migration code.
    """
    # because of the dynamic inheritance pattern used by the Prefect database,
    # it is difficult to get alembic to resolve references to indexes on inherited models
    #
    # to keep autogenerated migration code clean, we ignore the following indexes:
    # * functional indexes (ending in 'desc', 'asc'), if an index with the same name already exists
    # * trigram indexes that already exist
    # * case_insensitive indexes that already exist
    if type_ == "index":
        if not reflected and any([name.endswith(suffix) for suffix in {"asc", "desc"}]):
            return compare_to is None or object.name != compare_to.name
        elif reflected and (
            name.startswith("gin") or name.endswith("case_insensitive")
        ):
            return False
    return True