A
A
Alexander2020-01-04 16:30:45
MySQL
Alexander, 2020-01-04 16:30:45

How to correctly update information in a table with nested sets?

Problem - figures in some records in right and left fields got off. There is information about the hierarchy (parent_id field) and it is correct. How to recalculate right and left for the whole tree?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-01-04
@firedragon

First, solve the problem with the downed code. Some rubbish destroyed your structure.
And secondly, restart the build.
PS How do you imagine editing errors? Let's say you lost a parent. How will you contribute?
In theory, take the entire range and lay it out to the right to the left, but without seeing the code and not knowing what the mistake is, this is mother's occupation.

X
xmoonlight, 2020-01-04
@xmoonlight

1. Write a structure integrity check in the code.
2. Watch for validation errors and correct them consistently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question