From 8608b2830091e330d8e2a7fcd72eef9395459f53 Mon Sep 17 00:00:00 2001 From: Anders Gustafsson <34234789+anders-photowall@users.noreply.github.com> Date: Tue, 16 Jun 2026 14:11:02 +0200 Subject: [PATCH] 8425 - stop using v2 category tables and views (#190) --- src/datasources/category-api.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/datasources/category-api.ts b/src/datasources/category-api.ts index 28844a0..07c7eab 100644 --- a/src/datasources/category-api.ts +++ b/src/datasources/category-api.ts @@ -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) );