8425 - stop using v2 category tables and views (#190)
Add new relic deployment marker / New Relic (push) Has been cancelled
Node.js CI with tests / build (16.x) (push) Has been cancelled
Sync staging from master / build (push) Has been cancelled

This commit is contained in:
Anders Gustafsson
2026-06-16 14:11:02 +02:00
committed by GitHub
parent eecc0f4f1b
commit 8608b28300
+5 -5
View File
@@ -82,7 +82,7 @@ WHERE product_category.product_id = ?
SELECT product_category.category_id as id,
categories.*
FROM product_category
JOIN v_categorytree_v2 categories ON product_category.category_id = categories.id
JOIN v_categorytree categories ON product_category.category_id = categories.id
WHERE product_category.product_id = ?
`;
@@ -101,7 +101,7 @@ WHERE product_category.product_id = ?
const { rows } = await this.cachedRaw(
/* sql */ `
SELECT id
FROM v_categorytree_v2
FROM v_categorytree
WHERE depth = 1
AND id NOT IN (${createQuestionMarksFromList(KNOWN_FACET_PARENT_IDS)})
`,
@@ -139,7 +139,7 @@ WHERE product_category.product_id = ?
WHEN id = ? THEN 'pattern'
ELSE 'motif'
END AS facet
FROM categories_v2_lft_rgt
FROM categories
WHERE id IN (${createQuestionMarksFromList(allFacetParentIds)})
)
SELECT
@@ -149,7 +149,7 @@ WHERE product_category.product_id = ?
array_agg(DISTINCT c.name) FILTER (WHERE fp.facet = 'pattern') AS pattern,
array_agg(DISTINCT fp.name) FILTER (WHERE fp.facet = 'motif') AS motif
FROM product_category pc
JOIN categories_v2_lft_rgt c ON c.id = pc.category_id
JOIN categories c ON c.id = pc.category_id
JOIN facet_parents fp ON c.lft > fp.lft AND c.rgt < fp.rgt
WHERE pc.product_id = ?
`,
@@ -227,7 +227,7 @@ WHERE product_category.product_id = ?
queryBuilder.whereIn('id', ids);
}
})
.from('v_categorytree_v2')
.from('v_categorytree')
// @ts-ignore
.cache(MINUTE)
);