Mercurial > dive4elements > river
diff flys-backend/doc/schema/postgresql-minfo.sql @ 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 | c3b2673eafbf |
children | fc32a4955087 |
line wrap: on
line diff
--- 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;