Byzanteam-Labs / hierarch

Tree structure & hierarchy for ecto models with ltree(Postgres)
MIT License
35 stars 3 forks source link

Changing the parent of a leaf with multiple descendants #14

Open alabama opened 4 years ago

alabama commented 4 years ago

Following usecase: moving

What would be the best approach with the functions provided by hierarch? It would not be enough to just change the path of C you would need to update all it's descendants (not only the children) to have the right ancestors. Any examples?

fahchen commented 4 years ago

That’s a good scenario. Maybe we should provide some common mutation functions.

alabama commented 4 years ago

Yeah I like the idea! Any updates on that?

dyyce commented 4 years ago

+1 on that