changeset 5402:f5063fa7f666 marking-single-beam

Add schema change for marking vessel single beam scans.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 06 Jul 2021 00:30:39 +0200
parents dcc692a333c0
children 85f19e924a43
files schema/gemma.sql schema/updates/1460/01.markings.sql schema/version.sql
diffstat 3 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/schema/gemma.sql	Mon Jul 05 08:31:46 2021 +0200
+++ b/schema/gemma.sql	Tue Jul 06 00:30:39 2021 +0200
@@ -353,7 +353,7 @@
     survey_type varchar PRIMARY KEY
 );
 
-INSERT INTO survey_types (survey_type) VALUES ('single'), ('multi');
+INSERT INTO survey_types (survey_type) VALUES ('single'), ('multi'), ('marking');
 
 CREATE TABLE coverage_types (
     coverage_type varchar PRIMARY KEY
@@ -828,6 +828,15 @@
             -- CHECK(ST_IsSimple(CAST(areas AS geometry))),
         PRIMARY KEY (sounding_result_id, height)
     )
+
+    CREATE TABLE sounding_results_marking_points (
+        sounding_result_id int NOT NULL REFERENCES sounding_results
+          ON DELETE CASCADE,
+        height numeric NOT NULL,
+        points geography(MULTIPOINT, 4326) NOT NULL,
+        PRIMARY KEY (sounding_result_id, height)
+    )
+
     --
     -- Fairway availability
     --
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/updates/1460/01.markings.sql	Tue Jul 06 00:30:39 2021 +0200
@@ -0,0 +1,15 @@
+INSERT INTO survey_types (survey_type) VALUES ('marking');
+
+CREATE TABLE waterway.sounding_results_marking_points (
+   sounding_result_id int NOT NULL REFERENCES waterway.sounding_results
+     ON DELETE CASCADE,
+   height numeric NOT NULL,
+   points geography(MULTIPOINT, 4326) NOT NULL,
+   PRIMARY KEY (sounding_result_id, height)
+);
+
+GRANT INSERT, UPDATE, DELETE ON waterway.sounding_results_marking_points
+  TO waterway_admin;
+
+GRANT SELECT ON waterway.sounding_results_marking_points
+  TO waterway_user;
--- a/schema/version.sql	Mon Jul 05 08:31:46 2021 +0200
+++ b/schema/version.sql	Tue Jul 06 00:30:39 2021 +0200
@@ -1,1 +1,1 @@
-INSERT INTO gemma_schema_version(version) VALUES (1453);
+INSERT INTO gemma_schema_version(version) VALUES (1460);