8425 - Align legacy ancestor view with v2 behavior (#565)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
-- Align legacy ancestor view with v2 behavior by excluding root category id = 1.
|
||||
CREATE OR REPLACE VIEW v_category_with_ancestors AS
|
||||
SELECT c.id,
|
||||
parent.id AS ancestor_id,
|
||||
parent.name
|
||||
FROM categories c
|
||||
LEFT JOIN categories parent
|
||||
ON parent.lft <= c.lft
|
||||
AND parent.rgt >= c.rgt
|
||||
AND parent.id <> 1
|
||||
WHERE c.id <> 1;
|
||||
Reference in New Issue
Block a user