diff schema/gemma.sql @ 1133:dd4071019676

Delete contour lines with their sounding result Contour lines are no independent data sets and thus can safely be deleted with sounding results. In passing, name the primary key as such.
author Tom Gottfried <tom@intevation.de>
date Wed, 07 Nov 2018 18:13:02 +0100
parents 2e6b47cdb2ca
children 930fdd8b474f
line wrap: on
line diff
--- a/schema/gemma.sql	Wed Nov 07 18:08:57 2018 +0100
+++ b/schema/gemma.sql	Wed Nov 07 18:13:02 2018 +0100
@@ -422,10 +422,11 @@
     )
 
     CREATE TABLE sounding_results_contour_lines (
-        sounding_result_id int NOT NULL REFERENCES sounding_results,
+        sounding_result_id int NOT NULL REFERENCES sounding_results
+            ON DELETE CASCADE,
         height numeric NOT NULL,
         lines geography(multilinestring, 4326) NOT NULL,
-        UNIQUE (sounding_result_id, height)
+        PRIMARY KEY (sounding_result_id, height)
     )
     -- A view to help geoserver serve contour lines.
     -- At least geoserver-2.13.2 does not serve type geography correctly