diff flys-backend/doc/schema/postgresql-minfo.sql @ 5406:e88d55d01cf5

SCHEMA CHANGE: additional columns and FK constraint for SQ-relation
author Tom Gottfried <tom@intevation.de>
date Mon, 25 Mar 2013 15:46:21 +0100
parents 6dd354e7abfc
children 6875a9f02097
line wrap: on
line diff
--- a/flys-backend/doc/schema/postgresql-minfo.sql	Mon Mar 25 15:38:54 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-minfo.sql	Mon Mar 25 15:46:21 2013 +0100
@@ -321,13 +321,19 @@
 CREATE TABLE sq_relation_value (
     id             int NOT NULL,
     sq_relation_id int NOT NULL,
+    m_station_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,
+    q_max          NUMERIC,
+    r_sq           NUMERIC,
+    n_tot          int,
+    n_outl         int,
+    cferguson      NUMERIC,
+    cduan          NUMERIC,
     PRIMARY KEY (id),
-    CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE
+    CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE,
+    CONSTRAINT fk_mstation_id FOREIGN KEY (m_station_id) REFERENCES measurement_station(id)
 );
 COMMIT;

http://dive4elements.wald.intevation.org