From 44e974b718bff7124ec89b14c6f01f635744d88b Mon Sep 17 00:00:00 2001 From: Rikard Bartholf Date: Wed, 5 Feb 2025 17:06:11 +0100 Subject: [PATCH] Update v_analytics_contract_customer_discounts (#459) * Initial commit * Rename view * Bump migration version --- migrations/000.534.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 migrations/000.534.sql diff --git a/migrations/000.534.sql b/migrations/000.534.sql new file mode 100644 index 0000000..7e69697 --- /dev/null +++ b/migrations/000.534.sql @@ -0,0 +1,15 @@ +DROP VIEW IF EXISTS public.v_funnel_contract_customers; +CREATE OR REPLACE VIEW public.v_funnel_contract_customers + AS + +SELECT contractcustomerid AS id, + companyname, + "delivery-company" AS delivery_companyname, + COALESCE(discount, 0) AS discount_percent, + country, + inserted, + updated + FROM contract_customers + ORDER BY 1; + +GRANT SELECT ON TABLE public.v_funnel_contract_customers TO funnel;