changeset 3793:8f232119011e

FYLS-Backend: Bring MINFO schemes of Oracle and PostgreSQL back in sync. flys-backend/trunk@5433 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 11 Sep 2012 13:55:08 +0000
parents 2e993a847e31
children 42db09d101f3
files flys-backend/ChangeLog flys-backend/doc/schema/oracle-minfo.sql flys-backend/doc/schema/postgresql-minfo.sql
diffstat 3 files changed, 37 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Mon Sep 10 13:00:59 2012 +0000
+++ b/flys-backend/ChangeLog	Tue Sep 11 13:55:08 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* postgresql-minfo.sql: Added missing tables.
+	* oracle-minfo.sql: Fixed small typos.
+
 2012-09-10	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* pom.xml: Java 1.6 -> 1.6
--- a/flys-backend/doc/schema/oracle-minfo.sql	Mon Sep 10 13:00:59 2012 +0000
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Tue Sep 11 13:55:08 2012 +0000
@@ -245,7 +245,7 @@
     name    VARCHAR(64)    NOT NULL,
     lower   NUMBER(38,3),
     upper   NUMBER(38,3),
-    unit_id NUMBER (38,0),
+    unit_id NUMBER(38,0),
     PRIMARY KEY (id),
     CONSTRAINT fk_gf_unit_id FOREIGN KEY (unit_id) REFERENCES units(id)
 );
@@ -306,7 +306,7 @@
 
 CREATE SEQUENCE WATERLEVEL_VALUES_ID_SEQ;
 
-CREATE TABLE waterlevel_values(
+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,
@@ -374,7 +374,7 @@
     fraction       VARCHAR(32)  NOT NULL,
     function       VARCHAR(32)  NOT NULL,
     km             NUMBER(38,3) NOT NULL,
-    a              NUMBER       NOT NULL,
+    a              NUMBER(38, 3) NOT NULL,
     b              NUMBER(38,3) NOT NULL,
     PRIMARY KEY (id),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id)
--- a/flys-backend/doc/schema/postgresql-minfo.sql	Mon Sep 10 13:00:59 2012 +0000
+++ b/flys-backend/doc/schema/postgresql-minfo.sql	Tue Sep 11 13:55:08 2012 +0000
@@ -306,7 +306,7 @@
 
 CREATE SEQUENCE WATERLEVEL_VALUES_ID_SEQ;
 
-CREATE TABLE waterlevel_values(
+CREATE TABLE waterlevel_values (
     id                      int NOT NULL,
     waterlevel_q_range_id   int NOT NULL,
     station                 NUMERIC NOT NULL,
@@ -351,4 +351,32 @@
     CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id)
 );
 
+
+CREATE SEQUENCE SQ_RELATION_ID_SEQ;
+
+CREATE TABLE sq_relation (
+    id               int NOT NULL,
+    river_id         int NOT NULL,
+    time_interval_id int NOT NULL,
+    description      VARCHAR(256),
+    PRIMARY KEY (id),
+    CONSTRAINT fk_sqr_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
+    CONSTRAINT fk_sqr_tinterval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id)
+);
+
+
+CREATE SEQUENCE SQ_RELATION_VALUES_ID_SEQ;
+
+CREATE TABLE sq_relation_value (
+    id             int NOT NULL,
+    sq_relation_id int NOT NULL,
+    parameter      VARCHAR(16)  NOT NULL,
+    fraction       VARCHAR(32)  NOT NULL,
+    function       VARCHAR(32)  NOT NULL,
+    km             NUMERIC NOT NULL,
+    a              NUMERIC NOT NULL,
+    b              NUMERIC NOT NULL,
+    PRIMARY KEY (id),
+    CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id)
+);
 COMMIT;

http://dive4elements.wald.intevation.org