Fixed bug in tree query with bootstrapped database

This commit is contained in:
Magnus Åhall 2025-08-18 18:35:40 +02:00
parent 00770fcd25
commit 9cf5c5f23f

View file

@ -149,7 +149,7 @@ func GetNodeTree(startNodeID, maxDepth int, withData bool) (topNode *Node, err e
n.id,
ns.depth+1 AS depth
FROM node n
INNER JOIN nodes ns ON ns.depth < $2 AND n.parent_id = ns.id
INNER JOIN nodes ns ON ns.depth < $2 AND n.parent_id = ns.id AND n.id != ns.id
)
SEARCH DEPTH FIRST BY id SET ordercol