comparison flys-backend/doc/schema/postgresql-minfo.sql @ 5406:e88d55d01cf5

SCHEMA CHANGE: additional columns and FK constraint for SQ-relation
author Tom Gottfried <tom@intevation.de>
date Mon, 25 Mar 2013 15:46:21 +0100
parents 6dd354e7abfc
children 6875a9f02097
comparison
equal deleted inserted replaced
5405:5ca06120b918 5406:e88d55d01cf5
319 CREATE SEQUENCE SQ_RELATION_VALUES_ID_SEQ; 319 CREATE SEQUENCE SQ_RELATION_VALUES_ID_SEQ;
320 320
321 CREATE TABLE sq_relation_value ( 321 CREATE TABLE sq_relation_value (
322 id int NOT NULL, 322 id int NOT NULL,
323 sq_relation_id int NOT NULL, 323 sq_relation_id int NOT NULL,
324 m_station_id int NOT NULL,
324 parameter VARCHAR(16) NOT NULL, 325 parameter VARCHAR(16) NOT NULL,
325 fraction VARCHAR(32) NOT NULL, 326 fraction VARCHAR(32) NOT NULL,
326 function VARCHAR(32) NOT NULL,
327 km NUMERIC NOT NULL,
328 a NUMERIC NOT NULL, 327 a NUMERIC NOT NULL,
329 b NUMERIC NOT NULL, 328 b NUMERIC NOT NULL,
330 PRIMARY KEY (id), 329 q_max NUMERIC,
331 CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE 330 r_sq NUMERIC,
331 n_tot int,
332 n_outl int,
333 cferguson NUMERIC,
334 cduan NUMERIC,
335 PRIMARY KEY (id),
336 CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE,
337 CONSTRAINT fk_mstation_id FOREIGN KEY (m_station_id) REFERENCES measurement_station(id)
332 ); 338 );
333 COMMIT; 339 COMMIT;

http://dive4elements.wald.intevation.org