Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-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 | 504cd5801785 |
children | 2594904640c3 |
comparison
equal
deleted
inserted
replaced
5205:31fd42400c84 | 5206:8667f629d238 |
---|---|
351 PRIMARY KEY (id), | 351 PRIMARY KEY (id), |
352 CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id) | 352 CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id) |
353 ); | 353 ); |
354 | 354 |
355 | 355 |
356 CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ; | |
357 CREATE TABLE measurement_station ( | |
358 id NUMBER(38) NOT NULL, | |
359 name VARCHAR(256) NOT NULL, | |
360 river_id NUMBER(38) NOT NULL, | |
361 station NUMBER(38,3) NOT NULL, | |
362 range_id NUMBER(38) NOT NULL, | |
363 measurement_type VARCHAR(64) NOT NULL, | |
364 riverside VARCHAR(16), | |
365 reference_gauge_id NUMBER(38), | |
366 observation_timerange_id NUMBER(38), | |
367 operator VARCHAR(64), | |
368 description VARCHAR(512), | |
369 PRIMARY KEY (id), | |
370 CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, | |
371 CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE, | |
372 CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE, | |
373 CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id), | |
374 UNIQUE (river_id, station) | |
375 ); | |
376 | |
377 | |
356 CREATE SEQUENCE SQ_RELATION_ID_SEQ; | 378 CREATE SEQUENCE SQ_RELATION_ID_SEQ; |
357 | 379 |
358 CREATE TABLE sq_relation ( | 380 CREATE TABLE sq_relation ( |
359 id NUMBER(38,0) NOT NULL, | 381 id NUMBER(38,0) NOT NULL, |
360 river_id NUMBER(38,0) NOT NULL, | 382 river_id NUMBER(38,0) NOT NULL, |