def column_index(archive_schema, orig_schema):
    """Create a mapping of names for the snapshot schema to their respective
    column in the archive schema. In addition, a mapping of identifier for
    columns in the snapshot schema to the column object at its schema position
    is created. Returns a tuple with the name mapping and the column identifier
    mapping.

    Parameters
    ----------
    archive_schema: dict(int: histore.archive.schema.ArchiveColumn)
        Dictionary mapping of column identifier to archive columns.
    orig_schema: list(histore.document.schema.Column)
        List of columns in a snapshot schema

    Returns
    -------
    dict, dict
    """
    archive_index = dict()
    orig_index = dict()
    for pos in range(len(orig_schema)):
        col = orig_schema[pos]
        if col in archive_index:
            raise ValueError('cannot match by name with duplicates')
        archive_index[col] = archive_schema[col.colid]
        orig_index[col.colid] = col, pos
    return archive_index, orig_index
