Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-minfo.sql @ 2834:daba3f895eb3
Improved the db schema to store sediment yield values.
flys-backend/trunk@4266 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Apr 2012 12:12:22 +0000 |
parents | 5b54a648f702 |
children | 6b541d85c5cf |
comparison
equal
deleted
inserted
replaced
2833:5b54a648f702 | 2834:daba3f895eb3 |
---|---|
234 v NUMBER(38,3) NOT NULL, | 234 v NUMBER(38,3) NOT NULL, |
235 description VARCHAR(256), | 235 description VARCHAR(256), |
236 PRIMARY KEY (id), | 236 PRIMARY KEY (id), |
237 CONSTRAINT fk_fvmv_measurements_id FOREIGN KEY (measurements_id) REFERENCES flow_velocity_measurements (id) | 237 CONSTRAINT fk_fvmv_measurements_id FOREIGN KEY (measurements_id) REFERENCES flow_velocity_measurements (id) |
238 ); | 238 ); |
239 | |
240 | |
241 CREATE SEQUENCE GRAIN_FRACTION_ID_SEQ; | |
242 | |
243 CREATE TABLE grain_fraction ( | |
244 id NUMBER(38,0) NOT NULL, | |
245 name VARCHAR(64) NOT NULL, | |
246 lower NUMBER(38,3), | |
247 upper NUMBER(38,3), | |
248 unit_id NUMBER (38,0), | |
249 PRIMARY KEY (id), | |
250 CONSTRAINT fk_gf_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) | |
251 ); | |
252 | |
253 | |
254 CREATE SEQUENCE SEDIMENT_YIELD_ID_SEQ; | |
255 | |
256 CREATE TABLE sediment_yield ( | |
257 id NUMBER(38,0) NOT NULL, | |
258 grain_fraction_id NUMBER(38,0), | |
259 unit_id NUMBER(38,0) NOT NULL, | |
260 time_interval_id NUMBER(38,0) NOT NULL, | |
261 PRIMARY KEY (id), | |
262 CONSTRAINT fk_sy_grain_fraction_id FOREIGN KEY (grain_fraction_id) REFERENCES grain_fraction(id), | |
263 CONSTRAINT fk_sy_unit_id FOREIGN KEY (unit_id) REFERENCES units(id), | |
264 CONSTRAINT fk_sy_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id) | |
265 ); | |
266 | |
267 | |
268 CREATE SEQUENCE SEDIMENT_YIELD_VALUES_ID_SEQ; | |
269 | |
270 CREATE TABLE sediment_yield_values ( | |
271 id NUMBER(38,0) NOT NULL, | |
272 sediment_yield_id NUMBER(38,0) NOT NULL, | |
273 station NUMBER(38,3) NOT NULL, | |
274 value NUMBER(38,3) NOT NULL, | |
275 PRIMARY KEY (id), | |
276 CONSTRAINT fk_syv_sediment_yield_id FOREIGN KEY (sediment_yield_id) REFERENCES sediment_yield(id) | |
277 ); |