# HG changeset patch # User Sascha L. Teichmann # Date 1347371708 0 # Node ID 8f232119011ef2dee4573025a7524320491650e0 # Parent 2e993a847e31b1c0f8c5a1b350a6fe4177a91c54 FYLS-Backend: Bring MINFO schemes of Oracle and PostgreSQL back in sync. flys-backend/trunk@5433 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2e993a847e31 -r 8f232119011e flys-backend/ChangeLog --- 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 + + * postgresql-minfo.sql: Added missing tables. + * oracle-minfo.sql: Fixed small typos. + 2012-09-10 Sascha L. Teichmann * pom.xml: Java 1.6 -> 1.6 diff -r 2e993a847e31 -r 8f232119011e flys-backend/doc/schema/oracle-minfo.sql --- 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) diff -r 2e993a847e31 -r 8f232119011e flys-backend/doc/schema/postgresql-minfo.sql --- 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;