From 978317f28fbfb30268c7fb70c19241a08c7fcba5 Mon Sep 17 00:00:00 2001 From: Remco van 't Veer Date: Thu, 22 Sep 2022 16:30:22 +0200 Subject: [PATCH] Expose verblijfsobject and pand tables SELECT bag.*, vbo.oppervlakte, pnd.oorspronkelijk_bouwjaar FROM bag LEFT JOIN verblijfsobject vbo ON vbo.id = bag.object_id LEFT JOIN verblijfsobject_pand vbo_pnd ON vbo_pnd.id = bag.object_id LEFT JOIN pand pnd ON vbo_pnd.pand_id = pnd.id --- src/straatnaam/data.clj | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/straatnaam/data.clj b/src/straatnaam/data.clj index 7260767..210aac0 100644 --- a/src/straatnaam/data.clj +++ b/src/straatnaam/data.clj @@ -31,8 +31,20 @@ "Select bag data in given version (schema name) as current." [db sn] (sql/db-do-commands db true - ["DROP VIEW IF EXISTS bag" - (str "CREATE VIEW bag AS SELECT * FROM " sn ".bag")]) + [(str "DROP VIEW IF EXISTS public.bag") + (str "CREATE VIEW public.bag AS SELECT * FROM " sn ".bag") + + (str "DROP VIEW IF EXISTS public.verblijfsobject") + (str "CREATE VIEW public.verblijfsobject AS + SELECT * FROM " sn ".verblijfsobject WHERE einddatum IS NULL") + + (str "DROP VIEW IF EXISTS public.pand") + (str "CREATE VIEW public.pand AS + SELECT * FROM " sn ".pand WHERE einddatum IS NULL") + + (str "DROP VIEW IF EXISTS public.verblijfsobject_pand") + (str "CREATE VIEW public.verblijfsobject_pand AS + SELECT * FROM " sn ".verblijfsobject_pand")]) (log/info "version activated:" sn)) (defn version-ok? -- 2.45.2