comparison schema/gemma.sql @ 4967:3f704ebad0c5 fairway-marks-import

Follow-up of rev. 1b309a8e7673 for DAYMAR
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Feb 2020 16:18:44 +0100
parents be713316b47a
children de190de05f67
comparison
equal deleted inserted replaced
4966:3530d91c3da3 4967:3f704ebad0c5
1020 ) AS fairway_marks_boyspp) 1020 ) AS fairway_marks_boyspp)
1021 )) 1021 ))
1022 1022
1023 -- Additional attributes for IENC features DAYMAR/daymar 1023 -- Additional attributes for IENC features DAYMAR/daymar
1024 CREATE TABLE fairway_marks_daymar ( 1024 CREATE TABLE fairway_marks_daymar (
1025 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
1026 colour varchar, 1025 colour varchar,
1027 colpat varchar, 1026 colpat varchar,
1028 condtn int, 1027 condtn int,
1029 topshp int, 1028 topshp int
1030 orient double precision
1031 ) INHERITS (fairway_marks) 1029 ) INHERITS (fairway_marks)
1030
1031 CREATE TABLE fairway_marks_daymar_hydro (
1032 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
1033 ) INHERITS (fairway_marks_daymar)
1032 -- Prevent identical entries using composite type comparison 1034 -- Prevent identical entries using composite type comparison
1033 -- (i.e. considering two NULL values in a field equal): 1035 -- (i.e. considering two NULL values in a field equal):
1034 CREATE UNIQUE INDEX fairway_marks_daymar_distinct_rows 1036 CREATE UNIQUE INDEX fairway_marks_daymar_hydro_distinct_rows
1035 ON fairway_marks_daymar 1037 ON fairway_marks_daymar_hydro
1036 ((CAST((validity, last_found, geom, 1038 ((CAST((validity, last_found, geom,
1037 datsta, datend, persta, perend, objnam, nobjnm, inform, ninfom, 1039 datsta, datend, persta, perend, objnam, nobjnm, inform, ninfom,
1038 scamin, picrep, txtdsc, sordat, sorind, 1040 scamin, picrep, txtdsc, sordat, sorind,
1039 0, colour, colpat, condtn, topshp, orient 1041 colour, colpat, condtn, topshp, 0
1040 ) AS fairway_marks_daymar) 1042 ) AS fairway_marks_daymar_hydro)
1041 )) 1043 ))
1042 1044
1045 CREATE TABLE fairway_marks_daymar_ienc (
1046 orient double precision,
1047 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
1048 ) INHERITS (fairway_marks_daymar)
1049 -- Prevent identical entries using composite type comparison
1050 -- (i.e. considering two NULL values in a field equal):
1051 CREATE UNIQUE INDEX fairway_marks_daymar_ienc_distinct_rows
1052 ON fairway_marks_daymar_ienc
1053 ((CAST((validity, last_found, geom,
1054 datsta, datend, persta, perend, objnam, nobjnm, inform, ninfom,
1055 scamin, picrep, txtdsc, sordat, sorind,
1056 colour, colpat, condtn, topshp, orient, 0
1057 ) AS fairway_marks_daymar_ienc)
1058 ))
1059
1043 CREATE TABLE fairway_marks_daymar_dirimps ( 1060 CREATE TABLE fairway_marks_daymar_dirimps (
1044 fm_daymar_id int REFERENCES fairway_marks_daymar, 1061 fm_daymar_id int REFERENCES fairway_marks_daymar_ienc,
1045 dirimp smallint REFERENCES dirimps, 1062 dirimp smallint REFERENCES dirimps,
1046 PRIMARY KEY (fm_daymar_id, dirimp) 1063 PRIMARY KEY (fm_daymar_id, dirimp)
1047 ) 1064 )
1048 1065
1049 -- Additional attributes for IENC feature LIGHTS 1066 -- Additional attributes for IENC feature LIGHTS