comparison flys-backend/doc/schema/oracle-minfo.sql @ 5448:b279f2d4bc78

SCHEMA CHANGE: fixed constraints in MINFO and removed obsolete column
author Tom Gottfried <tom.gottfried@intevation.de>
date Wed, 27 Mar 2013 10:25:45 +0100
parents 7c1dd9c3f6bd
children 303701ab73c6
comparison
equal deleted inserted replaced
5447:7876163fc40e 5448:b279f2d4bc78
38 CREATE SEQUENCE BED_HEIGHT_SINGLE_ID_SEQ; 38 CREATE SEQUENCE BED_HEIGHT_SINGLE_ID_SEQ;
39 39
40 CREATE TABLE bed_height_single ( 40 CREATE TABLE bed_height_single (
41 id NUMBER(38,0) NOT NULL, 41 id NUMBER(38,0) NOT NULL,
42 river_id NUMBER(38,0) NOT NULL, 42 river_id NUMBER(38,0) NOT NULL,
43 year NUMBER(38,0) NOT NULL, 43 year NUMBER(38,0),
44 sounding_width NUMBER(38,0) NOT NULL, 44 sounding_width NUMBER(38,0),
45 type_id NUMBER(38,0) NOT NULL, 45 type_id NUMBER(38,0) NOT NULL,
46 location_system_id NUMBER(38,0) NOT NULL, 46 location_system_id NUMBER(38,0) NOT NULL,
47 cur_elevation_model_id NUMBER(38,0) NOT NULL, 47 cur_elevation_model_id NUMBER(38,0) NOT NULL,
48 old_elevation_model_id NUMBER(38,0), 48 old_elevation_model_id NUMBER(38,0),
49 range_id NUMBER(38,0) NOT NULL, 49 range_id NUMBER(38,0),
50 evaluation_by VARCHAR(255), 50 evaluation_by VARCHAR(255),
51 description VARCHAR(255), 51 description VARCHAR(255),
52 PRIMARY KEY(id), 52 PRIMARY KEY(id),
53 CONSTRAINT fk_bed_single_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), 53 CONSTRAINT fk_bed_single_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
54 CONSTRAINT fk_type FOREIGN KEY (type_id) REFERENCES bed_height_type(id), 54 CONSTRAINT fk_type FOREIGN KEY (type_id) REFERENCES bed_height_type(id),
67 time_interval_id NUMBER(38,0) NOT NULL, 67 time_interval_id NUMBER(38,0) NOT NULL,
68 -- sounding_with NUMBER(38,0) NOT NULL, 68 -- sounding_with NUMBER(38,0) NOT NULL,
69 -- type_id NUMBER(38,0) NOT NULL, 69 -- type_id NUMBER(38,0) NOT NULL,
70 cur_elevation_model_id NUMBER(38,0) NOT NULL, 70 cur_elevation_model_id NUMBER(38,0) NOT NULL,
71 old_elevation_model_id NUMBER(38,0), 71 old_elevation_model_id NUMBER(38,0),
72 range_id NUMBER(38,0) NOT NULL, 72 range_id NUMBER(38,0),
73 evaluation_by VARCHAR(255), 73 evaluation_by VARCHAR(255),
74 description VARCHAR(255), 74 description VARCHAR(255),
75 PRIMARY KEY(id), 75 PRIMARY KEY(id),
76 CONSTRAINT fk_time_interval FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id), 76 CONSTRAINT fk_time_interval FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id),
77 CONSTRAINT fk_epoch_cur_elevation_model FOREIGN KEY (cur_elevation_model_id) REFERENCES elevation_model(id), 77 CONSTRAINT fk_epoch_cur_elevation_model FOREIGN KEY (cur_elevation_model_id) REFERENCES elevation_model(id),
281 CREATE TABLE measurement_station ( 281 CREATE TABLE measurement_station (
282 id NUMBER(38) NOT NULL, 282 id NUMBER(38) NOT NULL,
283 name VARCHAR(256) NOT NULL, 283 name VARCHAR(256) NOT NULL,
284 river_id NUMBER(38) NOT NULL, 284 river_id NUMBER(38) NOT NULL,
285 station NUMBER(38,3) NOT NULL, 285 station NUMBER(38,3) NOT NULL,
286 range_id NUMBER(38) NOT NULL, 286 range_id NUMBER(38),
287 measurement_type VARCHAR(64) NOT NULL, 287 measurement_type VARCHAR(64) NOT NULL,
288 riverside VARCHAR(16), 288 riverside VARCHAR(16),
289 reference_gauge_id NUMBER(38), 289 reference_gauge_id NUMBER(38),
290 observation_timerange_id NUMBER(38), 290 observation_timerange_id NUMBER(38),
291 operator VARCHAR(64), 291 operator VARCHAR(64),
316 316
317 CREATE TABLE sq_relation_value ( 317 CREATE TABLE sq_relation_value (
318 id NUMBER(38,0) NOT NULL, 318 id NUMBER(38,0) NOT NULL,
319 sq_relation_id NUMBER(38,0) NOT NULL, 319 sq_relation_id NUMBER(38,0) NOT NULL,
320 measurement_station_id NUMBER(38,0) NOT NULL, 320 measurement_station_id NUMBER(38,0) NOT NULL,
321 parameter VARCHAR(16) NOT NULL,
322 fraction VARCHAR(32) NOT NULL, 321 fraction VARCHAR(32) NOT NULL,
323 a NUMBER(38,20) NOT NULL, 322 a NUMBER(38,20) NOT NULL,
324 b NUMBER(38,20) NOT NULL, 323 b NUMBER(38,20) NOT NULL,
325 qmax NUMBER(38,20), 324 qmax NUMBER(38,20),
326 rsq NUMBER(38,3), 325 rsq NUMBER(38,3),
328 noutl NUMBER(38,0), 327 noutl NUMBER(38,0),
329 cferguson NUMBER(38,20), 328 cferguson NUMBER(38,20),
330 cduan NUMBER(38,20), 329 cduan NUMBER(38,20),
331 PRIMARY KEY (id), 330 PRIMARY KEY (id),
332 CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id), 331 CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id),
333 CONSTRAINT fk_mstation_id FOREIGN KEY (m_station_id) REFERENCES measurement_station(id) 332 CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id)
334 ); 333 );

http://dive4elements.wald.intevation.org