Archive old migrations (#426)

* Archive old migrations

* Fix invalid placement of migrations
This commit is contained in:
Rikard Bartholf
2024-10-17 11:19:12 +02:00
committed by GitHub
parent 763262c108
commit ddcbd0afb0
500 changed files with 0 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
-- P5-6165: create datastudio view for product categories
drop view if exists v_analytics_product_categories;
create view v_analytics_product_categories as
select distinct
tree.id as category_id,
getsafexmlpath(tree.path::character varying, 2) as category_path,
category_texts.name as category_name,
product_category.product_id as product_id
from product_category
join categories on product_category.category_id = categories.id
join categories hidden_category on hidden_category.name::text = 'hidden'::text
join v_esales_categorytree_i18n tree on (tree.lft < categories.lft and tree.rgt > categories.rgt or categories.id = tree.id) and tree.id <> 1 and (tree.lft < hidden_category.lft or tree.lft > hidden_category.rgt)
join category_texts on tree.id = category_texts.category_id and tree.locale_id = category_texts.locale_id
where tree.locale_id = 3;
grant select on v_analytics_product_categories to datastudio;