comparison backend/doc/schema/postgresql.sql @ 5923:131f5f58ff7d

Schema change: leave it up to AFT whether time intervals are unique per gauge but do not accept duplicate bfg_id per gauge
author Tom Gottfried <tom@intevation.de>
date Wed, 08 May 2013 13:16:29 +0200
parents 4fafe8d147b2
children 6ea171b6d8d2
comparison
equal deleted inserted replaced
5922:8ed9b1edace6 5923:131f5f58ff7d
149 gauge_id int NOT NULL REFERENCES gauges(id) ON DELETE CASCADE, 149 gauge_id int NOT NULL REFERENCES gauges(id) ON DELETE CASCADE,
150 description VARCHAR(256) NOT NULL, 150 description VARCHAR(256) NOT NULL,
151 bfg_id VARCHAR(50), 151 bfg_id VARCHAR(50),
152 kind int NOT NULL DEFAULT 0, 152 kind int NOT NULL DEFAULT 0,
153 time_interval_id int REFERENCES time_intervals(id), 153 time_interval_id int REFERENCES time_intervals(id),
154 UNIQUE(gauge_id, time_interval_id, kind) 154 UNIQUE(gauge_id, bfg_id, kind)
155 ); 155 );
156 156
157 -- Values of the Abflusstafeln 157 -- Values of the Abflusstafeln
158 CREATE SEQUENCE DISCHARGE_TABLE_VALUES_ID_SEQ; 158 CREATE SEQUENCE DISCHARGE_TABLE_VALUES_ID_SEQ;
159 159

http://dive4elements.wald.intevation.org