comparison backend/doc/schema/postgresql.sql @ 5883:4f35b34f4efa

Schema change: add constraint to discharge tables
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 30 Apr 2013 12:53:10 +0200
parents 5aa05a7a34b7
children c1abd48a03e2
comparison
equal deleted inserted replaced
5882:7100059790df 5883:4f35b34f4efa
147 id int PRIMARY KEY NOT NULL, 147 id int PRIMARY KEY NOT NULL,
148 gauge_id int NOT NULL REFERENCES gauges(id) ON DELETE CASCADE, 148 gauge_id int NOT NULL REFERENCES gauges(id) ON DELETE CASCADE,
149 description VARCHAR(256) NOT NULL, 149 description VARCHAR(256) NOT NULL,
150 bfg_id VARCHAR(50), 150 bfg_id VARCHAR(50),
151 kind int NOT NULL DEFAULT 0, 151 kind int NOT NULL DEFAULT 0,
152 time_interval_id int REFERENCES time_intervals(id) 152 time_interval_id int REFERENCES time_intervals(id),
153 153 UNIQUE(gauge_id, time_interval_id, kind)
154 -- TODO: better checks
155 -- UNIQUE (gauge_id, kind, time_interval_id)
156 ); 154 );
157 155
158 -- Values of the Abflusstafeln 156 -- Values of the Abflusstafeln
159 CREATE SEQUENCE DISCHARGE_TABLE_VALUES_ID_SEQ; 157 CREATE SEQUENCE DISCHARGE_TABLE_VALUES_ID_SEQ;
160 158

http://dive4elements.wald.intevation.org