Create v_funnel_collections (#423)

* Add query

* Substitute sub-query with JOIN

* Fix typo in view

* Fix typo in view

* 🎨 Cleanup

* Remove redundant GRANT

* Fix revision for 504
This commit is contained in:
Rikard Bartholf
2024-10-15 14:52:50 +02:00
committed by GitHub
parent 376246992a
commit 07e8ebd552
+15
View File
@@ -0,0 +1,15 @@
-- View: public.v_funnel_collections
DROP VIEW public.v_funnel_collections;
CREATE VIEW public.v_funnel_collections
AS
SELECT c.id AS collection_id,
c.name AS collection_name,
c.inserted AS date_added,
cp.product_id,
cp.inserted AS product_date_added
FROM collections c
JOIN collections_products cp ON c.id = cp.collection_id;
GRANT SELECT ON TABLE public.v_funnel_collections TO funnel;