# HG changeset patch # User Sascha L. Teichmann # Date 1304853639 0 # Node ID 4f2d8980415fb44c720eafcc918dd57804c8073a # Parent a92da0b3e8e78516f9da6a2c9e5e575b60616594 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 diff -r a92da0b3e8e7 -r 4f2d8980415f flys-backend/ChangeLog --- 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 +2011-05-08 Sascha L. Teichmann + + * 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 * src/main/java/de/intevation/flys/importer/WstParser.java: There are wst files where column names are not unique. diff -r a92da0b3e8e7 -r 4f2d8980415f flys-backend/doc/schema/postgresql.sql --- 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