diff flys-backend/doc/schema/oracle-minfo.sql @ 2841:6be2bf2492f9

Added MINFO specific waterlevel relations. flys-backend/trunk@4280 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 20 Apr 2012 06:59:03 +0000
parents 71175502d868
children c4db0f75a94a
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-minfo.sql	Thu Apr 19 12:48:53 2012 +0000
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Fri Apr 20 06:59:03 2012 +0000
@@ -278,3 +278,40 @@
     PRIMARY KEY (id),
     CONSTRAINT fk_syv_sediment_yield_id FOREIGN KEY (sediment_yield_id) REFERENCES sediment_yield(id)
 );
+
+
+CREATE SEQUENCE WATERLEVEL_ID_SEQ;
+
+CREATE TABLE waterlevel (
+    id          NUMBER(38,0) NOT NULL,
+    river_id    NUMBER(38,0) NOT NULL,
+    unit_id     NUMBER(38,0) NOT NULL,
+    description VARCHAR(256),
+    PRIMARY KEY (id),
+    CONSTRAINT fk_w_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
+    CONSTRAINT fk_w_unit_id FOREIGN KEY (unit_id) REFERENCES units(id)
+);
+
+
+CREATE SEQUENCE WATERLEVEL_Q_RANGES_ID_SEQ;
+
+CREATE TABLE waterlevel_q_range (
+    id              NUMBER(38,0) NOT NULL,
+    waterlevel_id   NUMBER(38,0) NOT NULL,
+    q               NUMBER(38,2) NOT NULL,
+    PRIMARY KEY (id),
+    CONSTRAINT fk_wqr_waterlevel_id FOREIGN KEY (waterlevel_id) REFERENCES waterlevel(id)
+);
+
+
+CREATE SEQUENCE WATERLEVEL_VALUES_ID_SEQ;
+
+CREATE TABLE waterlevel_values(
+    id                      NUMBER(38,0) NOT NULL,
+    waterlevel_q_range_id   NUMBER(38,0) NOT NULL,
+    station                 NUMBER(38,0) NOT NULL,
+    w                       NUMBER(38,0) NOT NULL,
+    PRIMARY KEY (id),
+    CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id)
+);
+

http://dive4elements.wald.intevation.org