changeset 8706:94cddb00f934

(issue1750) Apply schema changes to oracle, which are already done for PostgreSQL.
author Tom Gottfried <tom@intevation.de>
date Fri, 24 Apr 2015 15:06:38 +0200
parents 682a26e4158b
children f0ea2063b58e
files backend/doc/schema/oracle-minfo.sql
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/backend/doc/schema/oracle-minfo.sql	Thu Apr 23 19:20:40 2015 +0200
+++ b/backend/doc/schema/oracle-minfo.sql	Fri Apr 24 15:06:38 2015 +0200
@@ -325,6 +325,7 @@
     operator                 VARCHAR2(64 CHAR),
     commentary               VARCHAR2(512 CHAR),
     PRIMARY KEY (id),
+    CHECK(measurement_type IN ('Geschiebe', 'Schwebstoff')),
     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)
@@ -374,11 +375,9 @@
 
 CREATE TABLE sq_relation (
     id               NUMBER(38,0) NOT NULL,
-    river_id         NUMBER(38,0) NOT NULL,
     time_interval_id NUMBER(38,0) NOT NULL,
     description      VARCHAR(256),
     PRIMARY KEY (id),
-    CONSTRAINT fk_sqr_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
     CONSTRAINT fk_sqr_tinterval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id)
 );
 
@@ -399,6 +398,7 @@
     cferguson                NUMBER(38,20),
     cduan                    NUMBER(38,20),
     PRIMARY KEY (id),
+    UNIQUE(sq_relation_id, measurement_station_id, parameter),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE,
     CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id) ON DELETE CASCADE
 );

http://dive4elements.wald.intevation.org