diff flys-backend/doc/schema/oracle-minfo.sql @ 5224:2594904640c3

SCHEMA CHANGE: analogue r5201. Here for Oracle
author Tom Gottfried <tom@intevation.de>
date Mon, 11 Mar 2013 18:17:12 +0100
parents 8667f629d238
children db196abd16ca
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-minfo.sql	Mon Mar 11 17:25:18 2013 +0100
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Mon Mar 11 18:17:12 2013 +0100
@@ -20,15 +20,17 @@
     CONSTRAINT fk_unit FOREIGN KEY (unit_id) REFERENCES units(id)
 );
 
-CREATE SEQUENCE BED_HEIGHT_TYPE_SEQ;
 
+-- lookup table for bedheight types
 CREATE TABLE bed_height_type (
     id          NUMBER(38,0) NOT NULL,
-    name        VARCHAR(16)  NOT NULL,
-    description VARCHAR(255),
+    type        VARCHAR(65)  NOT NULL,
     PRIMARY KEY(id)
 );
-
+INSERT INTO bed_height_type VALUES (1, 'Querprofil')
+INSERT INTO bed_height_type VALUES (2, 'Flächenpeilung')
+INSERT INTO bed_height_type VALUES (3, 'Flächen- u. Querprofilpeilungen')
+INSERT INTO bed_height_type VALUES (4, 'DGM')
 
 
 CREATE SEQUENCE BED_HEIGHT_SINGLE_ID_SEQ;
@@ -281,78 +283,6 @@
 );
 
 
-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,3) NOT NULL,
-    w                       NUMBER(38,2) NOT NULL,
-    PRIMARY KEY (id),
-    CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id)
-);
-
-
-CREATE SEQUENCE WATERLEVEL_DIFFERENCE_ID_SEQ;
-
-CREATE TABLE waterlevel_difference (
-    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_wd_river_id FOREIGN KEY (river_id) REFERENCES rivers (id),
-    CONSTRAINT fk_wd_unit_id FOREIGN KEY (unit_id) REFERENCES units(id)
-);
-
-
-CREATE SEQUENCE WATERLEVEL_DIFF_COLUMN_ID_SEQ;
-
-CREATE TABLE waterlevel_difference_column (
-    id              NUMBER(38,0) NOT NULL,
-    difference_id   NUMBER(38,0) NOT NULL,
-    description     VARCHAR(256),
-    PRIMARY KEY (id),
-    CONSTRAINT fk_wdc_difference_id FOREIGN KEY (difference_id) REFERENCES waterlevel_difference (id)
-);
-
-
-CREATE SEQUENCE WATERLEVEL_DIFF_VALUES_ID_SEQ;
-
-CREATE TABLE waterlevel_difference_values (
-    id          NUMBER(38,0) NOT NULL,
-    column_id   NUMBER(38,0) NOT NULL,
-    station     NUMBER(38,3) NOT NULL,
-    value       NUMBER(38,2) NOT NULL,
-    PRIMARY KEY (id),
-    CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id)
-);
-
-
 CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ;
 CREATE TABLE measurement_station (
     id                       NUMBER(38)   NOT NULL,

http://dive4elements.wald.intevation.org