# HG changeset patch # User Raimund Renkert # Date 1398859793 -7200 # Node ID 3f6b9fae16371bf6cb416d92cb051809f9721eb9 # Parent 6b880df95a3a7ceb784371f33041bf685fce174a Added tables for porosity and porosity values to postgres schema. diff -r 6b880df95a3a -r 3f6b9fae1637 backend/doc/schema/postgresql-minfo.sql --- a/backend/doc/schema/postgresql-minfo.sql Wed Mar 19 15:08:44 2014 +0100 +++ b/backend/doc/schema/postgresql-minfo.sql Wed Apr 30 14:09:53 2014 +0200 @@ -147,6 +147,35 @@ ); +CREATE SEQUENCE POROSITY_ID_SEQ; + +CREATE TABLE porosity ( + id int NOT NULL, + river_id int NOT NULL, + depth_id int NOT NULL, + description VARCHAR(256), + time_interval_id int NOT NULL, + PRIMARY KEY(id), + CONSTRAINT fk_p_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, + CONSTRAINT fk_p_depth_id FOREIGN KEY (depth_id) REFERENCES depths(id), + CONSTRAINT fk_p_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id) +); + + +CREATE SEQUENCE POROSITY_VALUES_ID_SEQ; + +CREATE TABLE porosity_values ( + id int NOT NULL, + porosity_id int NOT NULL, + station NUMERIC NOT NULL, + shore_offset NUMERIC, + porosity NUMERIC NOT NULL, + description VARCHAR(256), + PRIMARY KEY(id), + CONSTRAINT fk_pv_porosity_id FOREIGN KEY(porosity_id) REFERENCES porosity(id) ON DELETE CASCADE +); + + CREATE SEQUENCE MORPHOLOGIC_WIDTH_ID_SEQ; CREATE TABLE morphologic_width (