Mercurial > dive4elements > river
diff flys-backend/doc/schema/oracle-minfo.sql @ 2818:25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
flys-backend/trunk@4235 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 13 Apr 2012 12:33:26 +0000 |
parents | 8979f2294af9 |
children | 0c2567626754 |
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-minfo.sql Fri Apr 13 11:45:29 2012 +0000 +++ b/flys-backend/doc/schema/oracle-minfo.sql Fri Apr 13 12:33:26 2012 +0000 @@ -142,3 +142,27 @@ PRIMARY KEY(id), CONSTRAINT fk_sdv_sediment_density_id FOREIGN KEY(sediment_density_id) REFERENCES sediment_density(id) ); + + +CREATE SEQUENCE MORPHOLOGIC_WIDTH_ID_SEQ; + +CREATE TABLE morphologic_width ( + id NUMBER(38,0) NOT NULL, + river_id NUMBER(38,0) NOT NULL, + unit_id NUMBER(38,0) NOT NULL, + PRIMARY KEY(id), + CONSTRAINT fk_mw_river_id FOREIGN KEY(river_id) REFERENCES rivers(id), + CONSTRAINT fk_mw_unit_id FOREIGN KEY(unit_id) REFERENCES units(id) +); + + +CREATE SEQUENCE MORPH_WIDTH_VALUES_ID_SEQ; + +CREATE TABLE morphologic_width_values ( + id NUMBER(38,0) NOT NULL, + morphologic_width_id NUMBER(38,0) NOT NULL, + station NUMBER(38,3) NOT NULL, + width NUMBER(38,3) NOT NULL, + PRIMARY KEY(id), + CONSTRAINT fk_mwv_morphologic_width_id FOREIGN KEY (morphologic_width_id) REFERENCES morphologic_width(id) +);