comparison flys-backend/doc/schema/oracle-minfo.sql @ 2824:85b2b5e7377f

Improved the oracle db schema for MINFO specific flow velocity values. flys-backend/trunk@4241 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 16 Apr 2012 09:48:49 +0000
parents 13b3fcaa1b34
children ac13e466a55e
comparison
equal deleted inserted replaced
2823:13b3fcaa1b34 2824:85b2b5e7377f
165 width NUMBER(38,3) NOT NULL, 165 width NUMBER(38,3) NOT NULL,
166 description VARCHAR(256), 166 description VARCHAR(256),
167 PRIMARY KEY(id), 167 PRIMARY KEY(id),
168 CONSTRAINT fk_mwv_morphologic_width_id FOREIGN KEY (morphologic_width_id) REFERENCES morphologic_width(id) 168 CONSTRAINT fk_mwv_morphologic_width_id FOREIGN KEY (morphologic_width_id) REFERENCES morphologic_width(id)
169 ); 169 );
170
171
172 CREATE SEQUENCE DISCHARGE_ZONE_ID_SEQ;
173
174 CREATE TABLE discharge_zone (
175 id NUMBER(38,0) NOT NULL,
176 river_id NUMBER(38,0) NOT NULL,
177 named_main_value_id NUMBER(38,0) NOT NULL,
178 gauge_name VARCHAR(64) NOT NULL, -- this is not very proper, but there are gauges with no db instance
179 lower_factor NUMBER(38,2) NOT NULL,
180 upper_factor NUMBER(38,2) NOT NULL,
181 PRIMARY KEY(id),
182 CONSTRAINT fk_dz_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
183 CONSTRAINT fk_dz_nmv_id FOREIGN KEY (named_main_value_id) REFERENCES named_main_values(id)
184 );
185
186
187 CREATE SEQUENCE FLOW_VELOCITY_MODEL_ID_SEQ;
188
189 CREATE TABLE flow_velocity_model (
190 id NUMBER(38,0) NOT NULL,
191 river_id NUMBER(38,0) NOT NULL,
192 discharge_zone_id NUMBER(38,0) NOT NULL,
193 description VARCHAR(256),
194 PRIMARY KEY (id),
195 CONSTRAINT fk_fvm_river_id FOREIGN KEY (river_id) REFERENCES rivers(id),
196 CONSTRAINT fk_fvm_discharge_zone_id FOREIGN KEY (discharge_zone_id) REFERENCES discharge_zone (id)
197 );
198
199
200 CREATE SEQUENCE FLOW_VELOCITY_M_VALUES_ID_SEQ;
201
202 CREATE TABLE flow_velocity_model_values (
203 id NUMBER(38,0) NOT NULL,
204 flow_velocity_model_id NUMBER(38,0) NOT NULL,
205 station NUMBER(38,3) NOT NULL,
206 total_channel NUMBER(38,3) NOT NULL,
207 main_channel NUMBER(38,3) NOT NULL,
208 shear_stress NUMBER(38,3) NOT NULL,
209 PRIMARY KEY(id),
210 CONSTRAINT fk_fvv_flow_velocity_model_id FOREIGN KEY (flow_velocity_model_id) REFERENCES flow_velocity_model(id)
211 );
212
213
214
215 --CREATE SEQUENCE
216 --
217 --CREATE TABLE flow_velocity_measurements (
218 --
219 --);
220 --
221 --CREATE SEQUENCE
222 --
223 --CREATE TABLE flow_velocity_measurements_values (
224 --
225 --);

http://dive4elements.wald.intevation.org