# HG changeset patch # User Thomas Junk # Date 1580742018 -3600 # Node ID fb46882fa08dd35b444325dbf75496a2cbec3e6c # Parent 558668c329491ba35aa989d4d5885a39026a6cf4# Parent de12c9af3abf444f00716ff237499c0fb76cd4c9 merge diff -r 558668c32949 -r fb46882fa08d docker/Dockerfile.db --- a/docker/Dockerfile.db Mon Feb 03 16:00:04 2020 +0100 +++ b/docker/Dockerfile.db Mon Feb 03 16:00: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 diff -r 558668c32949 -r fb46882fa08d pkg/imports/bn.go --- a/pkg/imports/bn.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/imports/bn.go Mon Feb 03 16:00: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 diff -r 558668c32949 -r fb46882fa08d pkg/imports/wa.go --- a/pkg/imports/wa.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/imports/wa.go Mon Feb 03 16:00: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 { diff -r 558668c32949 -r fb46882fa08d pkg/imports/wp.go --- a/pkg/imports/wp.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/imports/wp.go Mon Feb 03 16:00: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 { diff -r 558668c32949 -r fb46882fa08d pkg/imports/wx.go --- a/pkg/imports/wx.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/imports/wx.go Mon Feb 03 16:00: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 { diff -r 558668c32949 -r fb46882fa08d pkg/pgxutils/errors.go --- a/pkg/pgxutils/errors.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/pgxutils/errors.go Mon Feb 03 16:00:18 2020 +0100 @@ -147,6 +147,16 @@ return } } + case "internal": + switch err.TableName { + case "user_profiles": + switch err.ConstraintName { + case "user_profiles_username_check": + m = "User name too long" + c = http.StatusBadRequest + return + } + } } case duplicateObject: switch { diff -r 558668c32949 -r fb46882fa08d pkg/wfs/download.go --- a/pkg/wfs/download.go Mon Feb 03 16:00:04 2020 +0100 +++ b/pkg/wfs/download.go Mon Feb 03 16:00: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)) } diff -r 558668c32949 -r fb46882fa08d schema/gemma.sql --- a/schema/gemma.sql Mon Feb 03 16:00:04 2020 +0100 +++ b/schema/gemma.sql Mon Feb 03 16:00: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),