Issues with liquibase generated data log for existing table of hierarchical data

I have a table with hierarchical data.
example schema: id | parent_id | …|some other columns
where parent_id references id of same table.
When I generate log from this table, shown below, Insert staments are generated are not respecting inserting the primary row first before secondary row[parent_id refers primary row id] that depends on it.
liquibase --includeObjects="" generateChangeLog --diffTypes data

Since data is huge manually fixing is not viable. Is there a solution from liquibase to address this issue. or any hint that would help is welcome. Thank you.

For anyone having similar issue: For me manually adjusting nodes is no go as there are many records. Hence I took route of XSLT based sorting.

  • XSLT xml sort candidate
  1. Simple Java program to process xslt against given xml file.

Suggestion: If liquibase can give –includeQuery similar to –includeObjects then it will give us placeholder where we can emphasize on order or records.

Hi @srinivasan.thoyyeti Thanks for joining the community. And thanks for posting your solution of XSLT sorting.
If you would like -includeQuery, I suggest you create an issue and PR on Github to add that.