changeset 4883:7878a1cde024

Merge
author Tom Gottfried <tom@intevation.de>
date Mon, 03 Feb 2020 14:22:18 +0100
parents e89c1140f0a8 (current diff) 566e9ee70d45 (diff)
children de12c9af3abf
files
diffstat 7 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/docker/Dockerfile.db	Mon Feb 03 14:00:26 2020 +0100
+++ b/docker/Dockerfile.db	Mon Feb 03 14:22:18 2020 +0100
@@ -34,10 +34,10 @@
 # Expose the PostgreSQL port
 EXPOSE 5432
 
-# Create GEMMA role and database
+# Create GEMMA roles and database
 WORKDIR /opt/gemma
-COPY schema/*.sql schema/*.sh ./
-COPY schema/demo-data ./demo-data/
+COPY --chown=postgres schema/*.sql schema/*.sh ./
+COPY --chown=postgres schema/demo-data ./demo-data/
 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \
     ./install-db.sh --demo --metapw "geo2Serv" && \
     $PGBIN/pg_ctl stop -m smart
--- a/pkg/imports/bn.go	Mon Feb 03 14:00:26 2020 +0100
+++ b/pkg/imports/bn.go	Mon Feb 03 14:22:18 2020 +0100
@@ -492,6 +492,7 @@
 	// Additional Information, only of interest when we change something, so
 	// it can be used for debugging if something goes wrong...
 	feedback.Info("Range: from %s to %s", bn.From_ISRS, bn.To_ISRS)
+	feedback.Info("Reference gauge: %s", bn.Fk_g_fid)
 
 	// Check if the new bottleneck intersects with the validity of existing
 	// for the same bottleneck_id we consider this an update and mark the
--- a/pkg/imports/wa.go	Mon Feb 03 14:00:26 2020 +0100
+++ b/pkg/imports/wa.go	Mon Feb 03 14:22:18 2020 +0100
@@ -137,7 +137,7 @@
 		return nil, fmt.Errorf("unknown feature type '%s'", wa.FeatureType)
 	}
 
-	feedback.Info("Found feature type '%s", wa.FeatureType)
+	feedback.Info("Found feature type '%s'", wa.FeatureType)
 
 	epsg, err := wfs.CRSToEPSG(ft.DefaultCRS)
 	if err != nil {
--- a/pkg/imports/wp.go	Mon Feb 03 14:00:26 2020 +0100
+++ b/pkg/imports/wp.go	Mon Feb 03 14:22:18 2020 +0100
@@ -219,7 +219,7 @@
 		return fmt.Errorf("unknown feature type '%s'", wp.FeatureType)
 	}
 
-	feedback.Info("Found feature type '%s", wp.FeatureType)
+	feedback.Info("Found feature type '%s'", wp.FeatureType)
 
 	epsg, err := wfs.CRSToEPSG(ft.DefaultCRS)
 	if err != nil {
--- a/pkg/imports/wx.go	Mon Feb 03 14:00:26 2020 +0100
+++ b/pkg/imports/wx.go	Mon Feb 03 14:22:18 2020 +0100
@@ -138,7 +138,7 @@
 		return nil, fmt.Errorf("unknown feature type '%s'", wx.FeatureType)
 	}
 
-	feedback.Info("Found feature type '%s", wx.FeatureType)
+	feedback.Info("Found feature type '%s'", wx.FeatureType)
 
 	epsg, err := wfs.CRSToEPSG(ft.DefaultCRS)
 	if err != nil {
--- a/pkg/wfs/download.go	Mon Feb 03 14:00:26 2020 +0100
+++ b/pkg/wfs/download.go	Mon Feb 03 14:22:18 2020 +0100
@@ -181,7 +181,8 @@
 		// Only use first namespace
 		ns := feature.Namespaces[0]
 		if wfs2 {
-			v.Set("NAMESPACES", fmt.Sprintf("(%s,%s)", ns.Space, ns.Local))
+			v.Set(
+				"NAMESPACES", fmt.Sprintf("xmlns(%s,%s)", ns.Space, ns.Local))
 		} else {
 			v.Set("NAMESPACE", fmt.Sprintf("(%s:%s)", ns.Space, ns.Local))
 		}
--- a/schema/gemma.sql	Mon Feb 03 14:00:26 2020 +0100
+++ b/schema/gemma.sql	Mon Feb 03 14:22:18 2020 +0100
@@ -27,7 +27,6 @@
 --
 
 -- Check if a given string can be used as a FROM item in an SQL statement
--- All objects in stmt should be schema qualified if not in the public schema
 CREATE OR REPLACE FUNCTION is_valid_from_item(stmt text) RETURNS boolean
 AS $$
 BEGIN
@@ -39,7 +38,6 @@
         RETURN false;
 END
 $$
-    SET search_path TO 'public'
     LANGUAGE plpgsql
     STRICT;
 
@@ -231,7 +229,7 @@
 LANGUAGE plpgsql
 AS $$
 BEGIN
-    IF NOT public.ST_Intersects((SELECT area
+    IF NOT st_intersects((SELECT area
                           FROM waterway.bottlenecks
                           WHERE bottleneck_id = NEW.bottleneck_id
                             AND validity @> NEW.date_info::timestamptz),