changeset 91:c38edd879e2e

Add profile attributes.
author Tom Gottfried <tom@intevation.de>
date Fri, 01 Jun 2018 19:50:58 +0200
parents a8878834adfb
children f11366b419ae
files wamos.sql
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wamos.sql	Fri Jun 01 19:32:44 2018 +0200
+++ b/wamos.sql	Fri Jun 01 19:50:58 2018 +0200
@@ -195,10 +195,20 @@
        FOR EACH ROW EXECUTE PROCEDURE update_date_info();
 
 CREATE TABLE wamos_waterway.waterway_profiles (
-       dummy_attrib varchar,
-       "..." varchar
-       -- TODO: add real profile attributes (DRC 2.2.3)
+       location isrs NOT NULL,
+       validity tstzrange NOT NULL,
+       EXCLUDE USING GIST (validity WITH &&),
+       PRIMARY KEY (location, validity),
+       lnwl smallint,
+       mwl smallint,
+       hnwl smallint,
+       fe30 smallint,
+       fe100 smallint,
+       date_info timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
+       source_organization varchar NOT NULL
        );
+CREATE TRIGGER waterway_profiles_date_info BEFORE UPDATE ON waterway_profiles
+       FOR EACH ROW EXECUTE PROCEDURE update_date_info();
 
 CREATE TABLE wamos_waterway.levels_of_service (
        level_of_service smallint PRIMARY KEY