changeset 7839:3f6b9fae1637

Added tables for porosity and porosity values to postgres schema.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 30 Apr 2014 14:09:53 +0200
parents 6b880df95a3a
children 02711de579cc
files backend/doc/schema/postgresql-minfo.sql
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 (

http://dive4elements.wald.intevation.org