Is the AFTER UPDATE trigger really needed?
amaury1093 opened this issue · 2 comments
amaury1093 commented
django-ltree-demo/demo/categories/sql/triggers.sql
Lines 48 to 54 in 5752252
I can't get my head around why the above trigger is needed. Imo it will do the same job again as the BEFORE UPDATE trigger.
Can you provide an example where the AFTER does something different than the BEFORE?
k4nar commented
This is the case covered by this test:
django-ltree-demo/tests/test_ltree.py
Lines 126 to 153 in 741de07
The trigger category_path_update_trg
only updates the path of the current row, but we need to update the path of all the descendants as well. This is what category_path_after_trg
does.
amaury1093 commented
💯