changeset 496:4f2d8980415f

Schema: Dropped constraint which forces discharge tables to have a unique time interval for a given gauge and kind. flys-backend/trunk@1850 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 08 May 2011 11:20:39 +0000
parents a92da0b3e8e7
children 67fd63e4ef66
files flys-backend/ChangeLog flys-backend/doc/schema/postgresql.sql
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Sun May 08 11:07:22 2011 +0000
+++ b/flys-backend/ChangeLog	Sun May 08 11:20:39 2011 +0000
@@ -1,4 +1,19 @@
-2011-05-05	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+2011-05-08	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/schema/postgresql.sql: Dropped constraint which
+	  forces discharge tables to have a unique time interval
+	  for a given gauge and kind.
+
+	  There are AT files (historical Mosel/Perl/Perl/1967-1981.at
+	  and Mosel/Perl/1967-1981-1.at) which violate this
+	  constraint. Its a technical question to the customer
+	  how to handle these cases.
+
+	  To adjust existing databases:
+
+	    ALTER TABLE discharge_tables DROP CONSTRAINT discharge_tables_gauge_id_key;
+
+2011-05-08	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/importer/WstParser.java:
 	  There are wst files where column names are not unique.
--- a/flys-backend/doc/schema/postgresql.sql	Sun May 08 11:07:22 2011 +0000
+++ b/flys-backend/doc/schema/postgresql.sql	Sun May 08 11:20:39 2011 +0000
@@ -116,10 +116,10 @@
     gauge_id         int NOT NULL REFERENCES gauges(id),
     description      VARCHAR(256) NOT NULL,
     kind             int NOT NULL DEFAULT 0,
-    time_interval_id int REFERENCES time_intervals(id),
+    time_interval_id int REFERENCES time_intervals(id)
 
     -- TODO: better checks
-    UNIQUE (gauge_id, time_interval_id)
+    -- UNIQUE (gauge_id, kind, time_interval_id)
 );
 
 -- Values of the Abflusstafeln

http://dive4elements.wald.intevation.org