Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-minfo.sql @ 2846:c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
flys-backend/trunk@4289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 24 Apr 2012 13:04:30 +0000 |
parents | c4db0f75a94a |
children | c36106f15ac9 |
comparison
equal
deleted
inserted
replaced
2845:a65b5b0ade6f | 2846:c1c6c9190636 |
---|---|
313 w NUMBER(38,2) NOT NULL, | 313 w NUMBER(38,2) NOT NULL, |
314 PRIMARY KEY (id), | 314 PRIMARY KEY (id), |
315 CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id) | 315 CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id) |
316 ); | 316 ); |
317 | 317 |
318 | |
319 CREATE SEQUENCE WATERLEVEL_DIFFERENCE_ID_SEQ; | |
320 | |
321 CREATE TABLE waterlevel_difference ( | |
322 id NUMBER(38,0) NOT NULL, | |
323 river_id NUMBER(38,0) NOT NULL, | |
324 unit NUMBER(38,0) NOT NULL, | |
325 description VARCHAR(256), | |
326 PRIMARY KEY (id), | |
327 CONSTRAINT fk_wd_river_id FOREIGN KEY (river_id) REFERENCES rivers (id) | |
328 ); | |
329 | |
330 | |
331 CREATE SEQUENCE WATERLEVEL_DIFF_COLUMN_ID_SEQ; | |
332 | |
333 CREATE TABLE waterlevel_difference_column ( | |
334 id NUMBER(38,0) NOT NULL, | |
335 difference_id NUMBER(38,0) NOT NULL, | |
336 description VARCHAR(256), | |
337 PRIMARY KEY (id), | |
338 CONSTRAINT fk_wdc_difference_id FOREIGN KEY (difference_id) REFERENCES waterlevel_difference (id) | |
339 ); | |
340 | |
341 | |
342 CREATE SEQUENCE WATERLEVEL_DIFF_VALUES_ID_SEQ; | |
343 | |
344 CREATE TABLE waterlevel_difference_values ( | |
345 id NUMBER(38,0) NOT NULL, | |
346 column_id NUMBER(38,0) NOT NULL, | |
347 station NUMBER(38,3) NOT NULL, | |
348 value NUMBER(38,2) NOT NULL, | |
349 PRIMARY KEY (id), | |
350 CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id) | |
351 ); | |
352 |