comparison flys-backend/doc/schema/postgresql-minfo.sql @ 5206:8667f629d238

SCHEME CHANGE: Add measurement_station to oracle table and rename comment column Comment is a reserved keyword in oracle. This also fixes a typo in the table name of time_intervals.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 08 Mar 2013 15:16:00 +0100
parents 646c154477fe
children db196abd16ca
comparison
equal deleted inserted replaced
5205:31fd42400c84 5206:8667f629d238
283 ); 283 );
284 284
285 285
286 CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ; 286 CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ;
287 CREATE TABLE measurement_station ( 287 CREATE TABLE measurement_station (
288 id int NOT NULL, 288 id int NOT NULL,
289 name VARCHAR(256) NOT NULL, 289 name VARCHAR(256) NOT NULL,
290 river_id int NOT NULL, 290 river_id int NOT NULL,
291 station NUMERIC NOT NULL, 291 station NUMERIC NOT NULL,
292 range_id int NOT NULL, 292 range_id int NOT NULL,
293 measurement_type VARCHAR(64) NOT NULL, 293 measurement_type VARCHAR(64) NOT NULL,
294 riverside VARCHAR(16), 294 riverside VARCHAR(16),
295 reference_gauge_id int, 295 reference_gauge_id int,
296 observation_timerange_id int, 296 observation_timerange_id int,
297 operator VARCHAR(64), 297 operator VARCHAR(64),
298 comment VARCHAR(512), 298 description VARCHAR(512),
299 PRIMARY KEY (id), 299 PRIMARY KEY (id),
300 CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, 300 CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
301 CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE, 301 CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE,
302 CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE, 302 CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE,
303 CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id), 303 CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id),
304 UNIQUE (river_id, station) 304 UNIQUE (river_id, station)
305 ); 305 );
306 306
307 307
308 CREATE SEQUENCE SQ_RELATION_ID_SEQ; 308 CREATE SEQUENCE SQ_RELATION_ID_SEQ;
309 309

http://dive4elements.wald.intevation.org