Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-minfo.sql @ 2841:6be2bf2492f9
Added MINFO specific waterlevel relations.
flys-backend/trunk@4280 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 20 Apr 2012 06:59:03 +0000 |
parents | 71175502d868 |
children | c4db0f75a94a |
comparison
equal
deleted
inserted
replaced
2840:71175502d868 | 2841:6be2bf2492f9 |
---|---|
276 station NUMBER(38,3) NOT NULL, | 276 station NUMBER(38,3) NOT NULL, |
277 value NUMBER(38,3) NOT NULL, | 277 value NUMBER(38,3) NOT NULL, |
278 PRIMARY KEY (id), | 278 PRIMARY KEY (id), |
279 CONSTRAINT fk_syv_sediment_yield_id FOREIGN KEY (sediment_yield_id) REFERENCES sediment_yield(id) | 279 CONSTRAINT fk_syv_sediment_yield_id FOREIGN KEY (sediment_yield_id) REFERENCES sediment_yield(id) |
280 ); | 280 ); |
281 | |
282 | |
283 CREATE SEQUENCE WATERLEVEL_ID_SEQ; | |
284 | |
285 CREATE TABLE waterlevel ( | |
286 id NUMBER(38,0) NOT NULL, | |
287 river_id NUMBER(38,0) NOT NULL, | |
288 unit_id NUMBER(38,0) NOT NULL, | |
289 description VARCHAR(256), | |
290 PRIMARY KEY (id), | |
291 CONSTRAINT fk_w_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), | |
292 CONSTRAINT fk_w_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) | |
293 ); | |
294 | |
295 | |
296 CREATE SEQUENCE WATERLEVEL_Q_RANGES_ID_SEQ; | |
297 | |
298 CREATE TABLE waterlevel_q_range ( | |
299 id NUMBER(38,0) NOT NULL, | |
300 waterlevel_id NUMBER(38,0) NOT NULL, | |
301 q NUMBER(38,2) NOT NULL, | |
302 PRIMARY KEY (id), | |
303 CONSTRAINT fk_wqr_waterlevel_id FOREIGN KEY (waterlevel_id) REFERENCES waterlevel(id) | |
304 ); | |
305 | |
306 | |
307 CREATE SEQUENCE WATERLEVEL_VALUES_ID_SEQ; | |
308 | |
309 CREATE TABLE waterlevel_values( | |
310 id NUMBER(38,0) NOT NULL, | |
311 waterlevel_q_range_id NUMBER(38,0) NOT NULL, | |
312 station NUMBER(38,0) NOT NULL, | |
313 w NUMBER(38,0) NOT NULL, | |
314 PRIMARY KEY (id), | |
315 CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id) | |
316 ); | |
317 |