diff schema/updates/1437/02.configure_wms-t.sql @ 5144:f11b9b50fcc9

Keep historic data of fairway dimensions ... and accordingly configure the respective layer as WMS-T.
author Tom Gottfried <tom@intevation.de>
date Tue, 31 Mar 2020 18:59:28 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/updates/1437/02.configure_wms-t.sql	Tue Mar 31 18:59:28 2020 +0200
@@ -0,0 +1,21 @@
+UPDATE sys_admin.published_services
+    SET
+        srid = 4326,
+        key_column = 'id',
+        wmst_attribute = 'valid_from',
+        wmst_end_attribute = 'valid_to',
+        view_def = $$
+            SELECT id,
+                lower(validity) AS valid_from,
+                COALESCE(upper(validity), current_timestamp) AS valid_to,
+                area,
+                level_of_service,
+                min_width,
+                max_width,
+                min_depth,
+                date_info,
+                source_organization,
+                staging_done
+            FROM waterway.fairway_dimensions
+            $$
+    WHERE schema = 'waterway' AND name = 'fairway_dimensions';