diff schema/gemma.sql @ 4913:8c1a3d5e3962 fairway-marks-import

Add import for fairway marks of type BOYCAR
author Tom Gottfried <tom@intevation.de>
date Mon, 10 Feb 2020 18:47:27 +0100
parents bfd8ef836998
children 399458e60a9b
line wrap: on
line diff
--- a/schema/gemma.sql	Mon Feb 10 18:11:52 2020 +0100
+++ b/schema/gemma.sql	Mon Feb 10 18:47:27 2020 +0100
@@ -885,6 +885,26 @@
         dirimp smallint REFERENCES dirimps,
         PRIMARY KEY (fm_bcnlat_id, dirimp)
     )
+
+    -- Additional attributes for IENC features BOYCAR
+    CREATE TABLE fairway_marks_boycar (
+        id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
+        colour varchar,
+        colpat varchar,
+        conrad int,
+        marsys int,
+        boyshp int
+    ) INHERITS (fairway_marks)
+    -- Prevent identical entries using composite type comparison
+    -- (i.e. considering two NULL values in a field equal):
+    CREATE UNIQUE INDEX fairway_marks_boycar_distinct_rows
+        ON fairway_marks_boycar
+        ((CAST((geom,
+                datsta, datend, persta, perend, objnam, nobjnm, inform, ninfom,
+                scamin, picrep, txtdsc, sordat, sorind,
+                0, colour, colpat, conrad, marsys, boyshp
+            ) AS fairway_marks_boycar)
+        ))
 ;