Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tree got broken very frequently and deleting node triggers deleting of random records #559

Open
ankitsinghdalal opened this issue Jun 16, 2022 · 1 comment

Comments

@ankitsinghdalal
Copy link

ankitsinghdalal commented Jun 16, 2022

I went through the code, where I noticed that upon deleting the node the children are also got deleted, and the children are calculated based on _lft filed using between query.

When the tree is broken, the _lft field is creating a mess where the wrong records are fetched as children and are deleted.

update
  `post`
set
  `deleted_at` = '2022-06-15 13:55:22',
  `post`.`updated_at` = '2022-06-15 13:55:22'
where
  `post`.`_lft` between 4200
  and 6000
  and `post`.`deleted_at` is null

What would be a possible way to correctly tackle this.

@dejury
Copy link

dejury commented Aug 31, 2022

See #226; maybe do a fixtree before executing the delete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants