Comments (8)
What is working unexpected wihtout these modifications?
When I was writing this post, I realized how I can soft delete descendants, more precisely how to restore them if parent is restored.
from laravel-nestedset.
Please, update to 2.4.1, remove your modifications and test
from laravel-nestedset.
I update and test.
The problem is that the values of _lft
and _rgt
are not updated after restore
. They contain values before delete
.
Table has 2 categories with _lft and _rgt values: 1-2, 3-4. First node is soft deleted. After that table will contain: 1-2, 1-2. And after restore it must be: 1-2, 3-4 (order doesn't matter), but has: 1-2, 1-2.
from laravel-nestedset.
Lft and rgt shouldnt be changed when soft deleted at all
29 íÁÒ 2015 Ç. 20:27 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:
I update and test.
The problem is that the values of _lft and _rgt are not updated after
restore. They contain values before delete.
Table has 2 categories with _lft and _rgt values: 1-2, 3-4. First node is
soft deleted. After that table will contain: 1-2, 1-2. And after restore it
must be: 1-2, 3-4 (order doesn't matter), but has: 1-2, 1-2.Reply to this email directly or view it on GitHub
#43 (comment)
.
from laravel-nestedset.
Ok.
from laravel-nestedset.
Ok what? Is this what happens or not?
29 íÁÒ 2015 Ç. 20:47 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:
Reply to this email directly or view it on GitHub
#43 (comment)
.
from laravel-nestedset.
SoftDeletes now should work. But I think not to change _lft and _rgt is not right. It will brake result of Node::getDescendantCount
and may be will brake another expectations. :)
from laravel-nestedset.
Well, yeah, but you shouldnt strongly rely on this values. Anyways, i would
wipe soft deleted models from db from time to time.
29 íÁÒ 2015 Ç. 21:05 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:
SoftDeletes now should work. But I think not to change _lft and _rgt is
not right. It will brake result of Node::getDescendantCount and may be
will brake another expectations. :)Reply to this email directly or view it on GitHub
#43 (comment)
.
from laravel-nestedset.
Related Issues (20)
- Integrity constraint violation error when deleting a node. HOT 1
- How to Move Between Root
- Use fully qualified key on QueryBuilder
- Problem with deadlock and broken tree when performing new registrations.
- My workaround to rebuildTree().
- My node has no parent, but has ancestors HOT 3
- Laravel 10 support HOT 4
- How to restrict descendants by status? HOT 1
- Efficiently restrict number of levels when using descendants()
- Is it possible to move QueryBuilder logic to trait? To support custom Builders
- You May Ordered Children with adding this method.
- Code runs in SQL error for height = 0 in QueryBuilder::columnPatch(...)
- fix parent function name
- Binary Tree Function
- finding siblings and parents
- Parent _lft and _rgt not updated after adding child using `create()` method HOT 2
- Sibling of the same category will be move as per id or record list. HOT 1
- Undefined method `append`
- Laravel 11 HOT 1
- Problem to require in Laravel 11 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-nestedset.