JavaScript disabled You need to activate JavaScript in order to use OpenProject! Learn more
Added by Mike McEldowney over 3 years ago
I'm trying to develop a report directly from the "openproject" Postgresql database for workpackages. How should I determine the parent workpackage for a particular workpackage in SQL?
Hi Mike,
The parent of a work package as all other relations are modeled through the relations table as a direct acyclic graph
To get the immediate parent, use this SQL:
SELECT * FROM relations WHERE to_id = <ID of the child> AND hierarchy = 1
Best
Oliver
Replies (1)
Hi Mike,
The parent of a work package as all other relations are modeled through the relations table as a direct acyclic graph
To get the immediate parent, use this SQL:
Best
Oliver