diff flys-backend/doc/schema/oracle-minfo.sql @ 5206:8667f629d238

SCHEME CHANGE: Add measurement_station to oracle table and rename comment column Comment is a reserved keyword in oracle. This also fixes a typo in the table name of time_intervals.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 08 Mar 2013 15:16:00 +0100
parents 504cd5801785
children 2594904640c3
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-minfo.sql	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Fri Mar 08 15:16:00 2013 +0100
@@ -353,6 +353,28 @@
 );
 
 
+CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ;
+CREATE TABLE measurement_station (
+    id                       NUMBER(38)   NOT NULL,
+    name                     VARCHAR(256) NOT NULL,
+    river_id                 NUMBER(38)   NOT NULL,
+    station                  NUMBER(38,3) NOT NULL,
+    range_id                 NUMBER(38)   NOT NULL,
+    measurement_type         VARCHAR(64)  NOT NULL,
+    riverside                VARCHAR(16),
+    reference_gauge_id       NUMBER(38),
+    observation_timerange_id NUMBER(38),
+    operator                 VARCHAR(64),
+    description              VARCHAR(512),
+    PRIMARY KEY              (id),
+    CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id),
+    UNIQUE (river_id, station)
+);
+
+
 CREATE SEQUENCE SQ_RELATION_ID_SEQ;
 
 CREATE TABLE sq_relation (

http://dive4elements.wald.intevation.org