M src/straatnaam/data.clj => src/straatnaam/data.clj +14 -2
@@ 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?