changeset 4573:26e9846ed69f iso-areas

Added caching table for iso areas of sounding differences.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 07 Oct 2019 12:37:17 +0200
parents 04a428766321
children daed8a92024a
files schema/gemma.sql schema/updates/1204/01.create-iso-areas.sql
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/schema/gemma.sql	Mon Oct 07 10:35:55 2019 +0200
+++ b/schema/gemma.sql	Mon Oct 07 12:37:17 2019 +0200
@@ -901,6 +901,14 @@
         lines  geography(multilinestring, 4326) NOT NULL,
         PRIMARY KEY (sounding_differences_id, height)
     )
+
+    CREATE TABLE sounding_differences_iso_areas (
+        sounding_differences_id int NOT NULL REFERENCES sounding_differences(id)
+                                    ON DELETE CASCADE,
+        height numeric NOT NULL,
+        areas  geography(MULTIPOLYGON, 4326) NOT NULL,
+        PRIMARY KEY (sounding_differences_id, height)
+    )
 ;
 
 COMMIT;
--- a/schema/updates/1204/01.create-iso-areas.sql	Mon Oct 07 10:35:55 2019 +0200
+++ b/schema/updates/1204/01.create-iso-areas.sql	Mon Oct 07 12:37:17 2019 +0200
@@ -8,9 +8,20 @@
     PRIMARY KEY (sounding_result_id, height)
 );
 
+CREATE TABLE caching.sounding_differences_iso_areas (
+    sounding_differences_id int NOT NULL REFERENCES caching.sounding_differences(id)
+                                ON DELETE CASCADE,
+    height numeric NOT NULL,
+    areas  geography(MULTIPOLYGON, 4326) NOT NULL,
+    PRIMARY KEY (sounding_differences_id, height)
+);
+
 GRANT INSERT, UPDATE, DELETE ON waterway.sounding_results_iso_areas
     TO waterway_admin;
 
 GRANT SELECT ON waterway.sounding_results_iso_areas
     TO waterway_user;
 
+GRANT SELECT, UPDATE, DELETE, INSERT ON caching.sounding_differences_iso_areas
+    TO waterway_user;
+