def create_timetravel_collection(arango_db, name, edge=False):
    """
    Creates an ArangoDB collection with appropriate indexes for a time travelling schema.

    arango_db - the database that will contain the collection.
    name - the name of the collection.
    edge - True for an edge collection (default False).

    Returns a python-arango collection instance.
    """

    col = arango_db.create_collection(name, edge=edge)
    col.add_persistent_index(['id', 'expired', 'created'])
    col.add_persistent_index(['expired', 'created', 'last_version'])
    return col