comparison flys-backend/doc/schema/oracle-minfo.sql @ 2812:a36a5407acbf

Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth. flys-backend/trunk@4228 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 13 Apr 2012 08:16:55 +0000
parents 04eeb45df27b
children 70b4a31a3306
comparison
equal deleted inserted replaced
2811:8926571e47fb 2812:a36a5407acbf
101 height NUMBER(38,2), 101 height NUMBER(38,2),
102 PRIMARY KEY(id), 102 PRIMARY KEY(id),
103 CONSTRAINT fk_bed_epoch_values_parent FOREIGN KEY (bed_height_epoch_id) REFERENCES bed_height_epoch(id) 103 CONSTRAINT fk_bed_epoch_values_parent FOREIGN KEY (bed_height_epoch_id) REFERENCES bed_height_epoch(id)
104 ); 104 );
105 105
106
107 CREATE SEQUENCE DEPTHS_ID_SEQ;
108
109 CREATE TABLE depths (
110 id NUMBER(38,0) NOT NULL,
111 lower NUMBER(38,2) NOT NULL,
112 upper NUMBER(38,2) NOT NULL,
113 unit_id NUMBER(38,2) NOT NULL,
114 PRIMARY KEY(id),
115 CONSTRAINT fk_depths_unit_id FOREIGN KEY (unit_id) REFERENCES units(id)
116 );
117
118
119 CREATE SEQUENCE SEDIMENT_DENSITY_ID_SEQ;
120
121 CREATE TABLE sediment_density (
122 id NUMBER(38,0) NOT NULL,
123 river_id NUMBER(38,0) NOT NULL,
124 depth_id NUMBER(38,0) NOT NULL,
125 PRIMARY KEY(id),
126 CONSTRAINT fk_sd_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
127 CONSTRAINT fk_sd_depth_id FOREIGN KEY (depth_id) REFERENCES depths(id)
128 );
129
130
131 CREATE SEQUENCE SEDIMENT_DENSITY_VALUES_ID_SEQ;
132
133 CREATE TABLE sediment_density_values (
134 id NUMBER(38,0) NOT NULL,
135 sediment_density_id NUMBER(38,0) NOT NULL,
136 station_id NUMBER(38,0) NOT NULL,
137 density NUMBER(38,2) NOT NULL,
138 description VARCHAR(256),
139 PRIMARY KEY(id),
140 CONSTRAINT fk_sdv_sediment_density_id FOREIGN KEY(sediment_density_id) REFERENCES sediment_density(id),
141 CONSTRAINT fk_sdv_station_id FOREIGN KEY (station_id) REFERENCES ranges(id)
142 );

http://dive4elements.wald.intevation.org