diff backend/doc/schema/postgresql-minfo.sql @ 8691:bfca77cbf353

(issue1750) There can be only one SQ-relation of a parameter for a time range (given by sq_relation_id) per station and some other attributes might be null.
author Tom Gottfried <tom@intevation.de>
date Fri, 17 Apr 2015 14:55:42 +0200
parents 1a4ad0d4231a
children 71b17f731762
line wrap: on
line diff
--- a/backend/doc/schema/postgresql-minfo.sql	Fri Apr 17 14:50:08 2015 +0200
+++ b/backend/doc/schema/postgresql-minfo.sql	Fri Apr 17 14:55:42 2015 +0200
@@ -399,6 +399,7 @@
     cferguson              NUMERIC,
     cduan                  NUMERIC,
     PRIMARY KEY (id),
+    UNIQUE(sq_relation_id, measurement_station_id, parameter),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id)
         REFERENCES sq_relation(id) ON DELETE CASCADE,
     CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id)

http://dive4elements.wald.intevation.org