@@ -30,16 +30,21 @@ graphAsRelation discon@(DisconnectedTransaction parentUUID _) graph@(Transaction
3030 where
3131 attributes = M.fromList [("id", Attribute "id" StringAtomType),
3232 ("parents", Attribute "parents" (RelationAtomType parentAttributes)),
33− ("current", Attribute "current" IntAtomType)
33+ ("current", Attribute "current" IntAtomType),
34+ ("head", Attribute "head" StringAtomType)
3435 ]
3536 parentAttributes = M.fromList [("id", Attribute "id" StringAtomType)]
3637 tupleGenerator transaction = case transactionParentsRelation transaction graph of
3738 Left err -> Left err
38− Right parentTransRel -> Right $ mkRelationTuple (S.fromList ["id", "parents", "current"]) $
39+ Right parentTransRel -> Right $ mkRelationTuple (S.fromList ["id", "parents", "current", "head"]) $
3940 (M.fromList
4041 [("id", StringAtom $ show (transactionUUID transaction)),
4142 ("parents", RelationAtom parentTransRel),
42− ("current", IntAtom $ if parentUUID == transactionUUID transaction then 1 else 0)])
43+ ("current", IntAtom $ if parentUUID == transactionUUID transaction then 1 else 0),
44+ ("head", StringAtom $ case headNameForTransaction transaction graph of
45+ Just headName -> headName
46+ Nothing -> "_")
47+ ])
4348
4449transactionParentsRelation :: Transaction -> TransactionGraph -> Either RelationalError Relation
4550transactionParentsRelation trans graph = do