Mercurial > dive4elements > river
annotate flys-backend/doc/schema/oracle-minfo.sql @ 2873:1894e0471eac
Added functions to retrieve bed height single and epoch values based on its owner and km range.
flys-backend/trunk@4439 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 18 May 2012 11:30:26 +0000 |
parents | c36106f15ac9 |
children | a2a33eff93aa |
rev | line source |
---|---|
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 SET AUTOCOMMIT ON; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 CREATE SEQUENCE LOCATION_SYSTEM_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 CREATE TABLE location_system ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 name VARCHAR(32) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 description VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 PRIMARY KEY(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 CREATE SEQUENCE ELEVATION_MODEL_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 CREATE TABLE elevation_model ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 name VARCHAR(32) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 unit_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 PRIMARY KEY(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 CONSTRAINT fk_unit FOREIGN KEY (unit_id) REFERENCES units(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 CREATE SEQUENCE BED_HEIGHT_TYPE_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 CREATE TABLE bed_height_type ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 name VARCHAR(16) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 description VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 PRIMARY KEY(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 CREATE SEQUENCE BED_HEIGHT_SINGLE_ID_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 CREATE TABLE bed_height_single ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 id NUMBER(38,0) NOT NULL, |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2807
diff
changeset
|
38 river_id NUMBER(38,0) NOT NULL, |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 year NUMBER(38,0) NOT NULL, |
2807
5ac1db5156be
Some oracle db schema adaptions specific to bed heights in MINFO.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2805
diff
changeset
|
40 sounding_width NUMBER(38,0) NOT NULL, |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 type_id NUMBER(38,0) NOT NULL, |
2807
5ac1db5156be
Some oracle db schema adaptions specific to bed heights in MINFO.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2805
diff
changeset
|
42 location_system_id NUMBER(38,0) NOT NULL, |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 cur_elevation_model_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 old_elevation_model_id NUMBER(38,0), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 range_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 evaluation_by VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 description VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 PRIMARY KEY(id), |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2807
diff
changeset
|
49 CONSTRAINT fk_bed_single_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 CONSTRAINT fk_type FOREIGN KEY (type_id) REFERENCES bed_height_type(id), |
2807
5ac1db5156be
Some oracle db schema adaptions specific to bed heights in MINFO.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2805
diff
changeset
|
51 CONSTRAINT fk_location_system FOREIGN KEY (location_system_id) REFERENCES location_system(id), |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 CONSTRAINT fk_cur_elevation_model FOREIGN KEY (cur_elevation_model_id) REFERENCES elevation_model(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 CONSTRAINT fk_old_elevation_model FOREIGN KEY (old_elevation_model_id) REFERENCES elevation_model(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 CONSTRAINT fk_range FOREIGN KEY (range_id) REFERENCES ranges(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 CREATE SEQUENCE BED_HEIGHT_EPOCH_ID_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 CREATE TABLE bed_height_epoch ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 id NUMBER(38,0) NOT NULL, |
2810
04eeb45df27b
Implemented model classes and importer classes for bed height epochs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
62 river_id NUMBER(38,0) NOT NULL, |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 time_interval_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 -- sounding_with NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 -- type_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 cur_elevation_model_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 old_elevation_model_id NUMBER(38,0), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 range_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 evaluation_by VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 description VARCHAR(255), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 PRIMARY KEY(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 CONSTRAINT fk_time_interval FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 CONSTRAINT fk_epoch_cur_elevation_model FOREIGN KEY (cur_elevation_model_id) REFERENCES elevation_model(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 CONSTRAINT fk_epoch_old_elevation_model FOREIGN KEY (old_elevation_model_id) REFERENCES elevation_model(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 CONSTRAINT fk_epoch_range FOREIGN KEY (range_id) REFERENCES ranges(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 CREATE SEQUENCE BED_SINGLE_VALUES_ID_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 CREATE TABLE bed_height_single_values ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 bed_height_single_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 station NUMBER(38,2) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 height NUMBER(38,2), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 uncertainty NUMBER(38,2), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 data_gap NUMBER(38,2) NOT NULL, |
2807
5ac1db5156be
Some oracle db schema adaptions specific to bed heights in MINFO.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2805
diff
changeset
|
88 sounding_width NUMBER(38,2) NOT NULL, |
2805
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 width NUMBER(38,2) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 PRIMARY KEY(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 CONSTRAINT fk_bed_single_values_parent FOREIGN KEY (bed_height_single_id) REFERENCES bed_height_single(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 CREATE SEQUENCE BED_EPOCH_VALUES_ID_SEQ; |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 CREATE TABLE bed_height_epoch_values ( |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 bed_height_epoch_id NUMBER(38,0) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 station NUMBER(38,2) NOT NULL, |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 height NUMBER(38,2), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 PRIMARY KEY(id), |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 CONSTRAINT fk_bed_epoch_values_parent FOREIGN KEY (bed_height_epoch_id) REFERENCES bed_height_epoch(id) |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 ); |
a55b7b35cc3a
First things for MINFO specific database schema.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
106 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
107 CREATE SEQUENCE DEPTHS_ID_SEQ; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
108 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
109 CREATE TABLE depths ( |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
110 id NUMBER(38,0) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
111 lower NUMBER(38,2) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
112 upper NUMBER(38,2) NOT NULL, |
2823
13b3fcaa1b34
Add MINFO schema for PostgreSQL
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2819
diff
changeset
|
113 unit_id NUMBER(38,0) NOT NULL, |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
114 PRIMARY KEY(id), |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
115 CONSTRAINT fk_depths_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
116 ); |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
117 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
118 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
119 CREATE SEQUENCE SEDIMENT_DENSITY_ID_SEQ; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
120 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
121 CREATE TABLE sediment_density ( |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
122 id NUMBER(38,0) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
123 river_id NUMBER(38,0) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
124 depth_id NUMBER(38,0) NOT NULL, |
2816
70b4a31a3306
Implemented the method stubs of the parser for sediment density and made some db schema adaptions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
125 unit_id NUMBER(38,0) NOT NULL, |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2816
diff
changeset
|
126 description VARCHAR(256), |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
127 PRIMARY KEY(id), |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
128 CONSTRAINT fk_sd_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), |
2816
70b4a31a3306
Implemented the method stubs of the parser for sediment density and made some db schema adaptions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
129 CONSTRAINT fk_sd_depth_id FOREIGN KEY (depth_id) REFERENCES depths(id), |
70b4a31a3306
Implemented the method stubs of the parser for sediment density and made some db schema adaptions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
130 CONSTRAINT fk_sd_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
131 ); |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
132 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
133 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
134 CREATE SEQUENCE SEDIMENT_DENSITY_VALUES_ID_SEQ; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
135 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
136 CREATE TABLE sediment_density_values ( |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
137 id NUMBER(38,0) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
138 sediment_density_id NUMBER(38,0) NOT NULL, |
2816
70b4a31a3306
Implemented the method stubs of the parser for sediment density and made some db schema adaptions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
139 station NUMBER(38,2) NOT NULL, |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
140 density NUMBER(38,2) NOT NULL, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
141 description VARCHAR(256), |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
142 PRIMARY KEY(id), |
2816
70b4a31a3306
Implemented the method stubs of the parser for sediment density and made some db schema adaptions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
143 CONSTRAINT fk_sdv_sediment_density_id FOREIGN KEY(sediment_density_id) REFERENCES sediment_density(id) |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2810
diff
changeset
|
144 ); |
2818
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
145 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
146 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
147 CREATE SEQUENCE MORPHOLOGIC_WIDTH_ID_SEQ; |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
148 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
149 CREATE TABLE morphologic_width ( |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
150 id NUMBER(38,0) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
151 river_id NUMBER(38,0) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
152 unit_id NUMBER(38,0) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
153 PRIMARY KEY(id), |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
154 CONSTRAINT fk_mw_river_id FOREIGN KEY(river_id) REFERENCES rivers(id), |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
155 CONSTRAINT fk_mw_unit_id FOREIGN KEY(unit_id) REFERENCES units(id) |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
156 ); |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
157 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
158 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
159 CREATE SEQUENCE MORPH_WIDTH_VALUES_ID_SEQ; |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
160 |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
161 CREATE TABLE morphologic_width_values ( |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
162 id NUMBER(38,0) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
163 morphologic_width_id NUMBER(38,0) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
164 station NUMBER(38,3) NOT NULL, |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
165 width NUMBER(38,3) NOT NULL, |
2819
0c2567626754
Tiny schema modification specific to MINFO morphological width values; added importer classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2818
diff
changeset
|
166 description VARCHAR(256), |
2818
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
167 PRIMARY KEY(id), |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
168 CONSTRAINT fk_mwv_morphologic_width_id FOREIGN KEY (morphologic_width_id) REFERENCES morphologic_width(id) |
25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2817
diff
changeset
|
169 ); |
2824
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
170 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
171 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
172 CREATE SEQUENCE DISCHARGE_ZONE_ID_SEQ; |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
173 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
174 CREATE TABLE discharge_zone ( |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
175 id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
176 river_id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
177 gauge_name VARCHAR(64) NOT NULL, -- this is not very proper, but there are gauges with no db instance |
2833
5b54a648f702
Finished flow velocity data import: finished parsing meta data of model files and repaired broken HQL statements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2829
diff
changeset
|
178 value NUMBER(38,3) NOT NULL, |
5b54a648f702
Finished flow velocity data import: finished parsing meta data of model files and repaired broken HQL statements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2829
diff
changeset
|
179 lower_discharge VARCHAR(16) NOT NULL, |
5b54a648f702
Finished flow velocity data import: finished parsing meta data of model files and repaired broken HQL statements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2829
diff
changeset
|
180 upper_discharge VARCHAR(16), |
2824
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
181 PRIMARY KEY(id), |
2833
5b54a648f702
Finished flow velocity data import: finished parsing meta data of model files and repaired broken HQL statements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2829
diff
changeset
|
182 CONSTRAINT fk_dz_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) |
2824
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
183 ); |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
184 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
185 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
186 CREATE SEQUENCE FLOW_VELOCITY_MODEL_ID_SEQ; |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
187 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
188 CREATE TABLE flow_velocity_model ( |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
189 id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
190 river_id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
191 discharge_zone_id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
192 description VARCHAR(256), |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
193 PRIMARY KEY (id), |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
194 CONSTRAINT fk_fvm_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
195 CONSTRAINT fk_fvm_discharge_zone_id FOREIGN KEY (discharge_zone_id) REFERENCES discharge_zone (id) |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
196 ); |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
197 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
198 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
199 CREATE SEQUENCE FLOW_VELOCITY_M_VALUES_ID_SEQ; |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
200 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
201 CREATE TABLE flow_velocity_model_values ( |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
202 id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
203 flow_velocity_model_id NUMBER(38,0) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
204 station NUMBER(38,3) NOT NULL, |
2828
ac13e466a55e
Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2824
diff
changeset
|
205 q NUMBER(38,3) NOT NULL, |
2824
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
206 total_channel NUMBER(38,3) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
207 main_channel NUMBER(38,3) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
208 shear_stress NUMBER(38,3) NOT NULL, |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
209 PRIMARY KEY(id), |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
210 CONSTRAINT fk_fvv_flow_velocity_model_id FOREIGN KEY (flow_velocity_model_id) REFERENCES flow_velocity_model(id) |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
211 ); |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
212 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
213 |
85b2b5e7377f
Improved the oracle db schema for MINFO specific flow velocity values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2823
diff
changeset
|
214 |
2829
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
215 CREATE SEQUENCE FV_MEASURE_ID_SEQ; |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
216 |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
217 CREATE TABLE flow_velocity_measurements ( |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
218 id NUMBER(38,0) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
219 river_id NUMBER(38,0) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
220 description VARCHAR(256), |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
221 PRIMARY KEY (id), |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
222 CONSTRAINT fk_fvm_rivers_id FOREIGN KEY (river_id) REFERENCES rivers(id) |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
223 ); |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
224 |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
225 CREATE SEQUENCE FV_MEASURE_VALUES_ID_SEQ; |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
226 |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
227 CREATE TABLE flow_velocity_measure_values ( |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
228 id NUMBER(38,0) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
229 measurements_id NUMBER(38,0) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
230 station NUMBER(38,3) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
231 datetime TIMESTAMP, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
232 w NUMBER(38,3) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
233 q NUMBER(38,3) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
234 v NUMBER(38,3) NOT NULL, |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
235 description VARCHAR(256), |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
236 PRIMARY KEY (id), |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
237 CONSTRAINT fk_fvmv_measurements_id FOREIGN KEY (measurements_id) REFERENCES flow_velocity_measurements (id) |
4074777afcfa
Added MINFO specific relations for flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2828
diff
changeset
|
238 ); |
2834
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
239 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
240 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
241 CREATE SEQUENCE GRAIN_FRACTION_ID_SEQ; |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
242 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
243 CREATE TABLE grain_fraction ( |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
244 id NUMBER(38,0) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
245 name VARCHAR(64) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
246 lower NUMBER(38,3), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
247 upper NUMBER(38,3), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
248 unit_id NUMBER (38,0), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
249 PRIMARY KEY (id), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
250 CONSTRAINT fk_gf_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
251 ); |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
252 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
253 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
254 CREATE SEQUENCE SEDIMENT_YIELD_ID_SEQ; |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
255 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
256 CREATE TABLE sediment_yield ( |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
257 id NUMBER(38,0) NOT NULL, |
2836
6b541d85c5cf
Added missing river_id column to sediment_yield relation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2834
diff
changeset
|
258 river_id NUMBER(38,0) NOT NULL, |
2834
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
259 grain_fraction_id NUMBER(38,0), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
260 unit_id NUMBER(38,0) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
261 time_interval_id NUMBER(38,0) NOT NULL, |
2840
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2836
diff
changeset
|
262 description VARCHAR(256), |
2834
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
263 PRIMARY KEY (id), |
2836
6b541d85c5cf
Added missing river_id column to sediment_yield relation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2834
diff
changeset
|
264 CONSTRAINT fk_sy_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), |
2834
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
265 CONSTRAINT fk_sy_grain_fraction_id FOREIGN KEY (grain_fraction_id) REFERENCES grain_fraction(id), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
266 CONSTRAINT fk_sy_unit_id FOREIGN KEY (unit_id) REFERENCES units(id), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
267 CONSTRAINT fk_sy_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id) |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
268 ); |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
269 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
270 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
271 CREATE SEQUENCE SEDIMENT_YIELD_VALUES_ID_SEQ; |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
272 |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
273 CREATE TABLE sediment_yield_values ( |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
274 id NUMBER(38,0) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
275 sediment_yield_id NUMBER(38,0) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
276 station NUMBER(38,3) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
277 value NUMBER(38,3) NOT NULL, |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
278 PRIMARY KEY (id), |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
279 CONSTRAINT fk_syv_sediment_yield_id FOREIGN KEY (sediment_yield_id) REFERENCES sediment_yield(id) |
daba3f895eb3
Improved the db schema to store sediment yield values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2833
diff
changeset
|
280 ); |
2841
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
281 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
282 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
283 CREATE SEQUENCE WATERLEVEL_ID_SEQ; |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
284 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
285 CREATE TABLE waterlevel ( |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
286 id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
287 river_id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
288 unit_id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
289 description VARCHAR(256), |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
290 PRIMARY KEY (id), |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
291 CONSTRAINT fk_w_river_id FOREIGN KEY (river_id) REFERENCES rivers(id), |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
292 CONSTRAINT fk_w_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
293 ); |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
294 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
295 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
296 CREATE SEQUENCE WATERLEVEL_Q_RANGES_ID_SEQ; |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
297 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
298 CREATE TABLE waterlevel_q_range ( |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
299 id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
300 waterlevel_id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
301 q NUMBER(38,2) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
302 PRIMARY KEY (id), |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
303 CONSTRAINT fk_wqr_waterlevel_id FOREIGN KEY (waterlevel_id) REFERENCES waterlevel(id) |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
304 ); |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
305 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
306 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
307 CREATE SEQUENCE WATERLEVEL_VALUES_ID_SEQ; |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
308 |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
309 CREATE TABLE waterlevel_values( |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
310 id NUMBER(38,0) NOT NULL, |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
311 waterlevel_q_range_id NUMBER(38,0) NOT NULL, |
2844
c4db0f75a94a
Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2841
diff
changeset
|
312 station NUMBER(38,3) NOT NULL, |
c4db0f75a94a
Prepared the importer to import MINFO specific waterlevel values and added a stub for a parser.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2841
diff
changeset
|
313 w NUMBER(38,2) NOT NULL, |
2841
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
314 PRIMARY KEY (id), |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
315 CONSTRAINT fk_wv_waterlevel_q_range_id FOREIGN KEY (waterlevel_q_range_id) REFERENCES waterlevel_q_range(id) |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
316 ); |
6be2bf2492f9
Added MINFO specific waterlevel relations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2840
diff
changeset
|
317 |
2846
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
318 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
319 CREATE SEQUENCE WATERLEVEL_DIFFERENCE_ID_SEQ; |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
320 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
321 CREATE TABLE waterlevel_difference ( |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
322 id NUMBER(38,0) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
323 river_id NUMBER(38,0) NOT NULL, |
2849
c36106f15ac9
Added missing constraint to relation 'waterlevel_difference'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2846
diff
changeset
|
324 unit_id NUMBER(38,0) NOT NULL, |
2846
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
325 description VARCHAR(256), |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
326 PRIMARY KEY (id), |
2849
c36106f15ac9
Added missing constraint to relation 'waterlevel_difference'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2846
diff
changeset
|
327 CONSTRAINT fk_wd_river_id FOREIGN KEY (river_id) REFERENCES rivers (id), |
c36106f15ac9
Added missing constraint to relation 'waterlevel_difference'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2846
diff
changeset
|
328 CONSTRAINT fk_wd_unit_id FOREIGN KEY (unit_id) REFERENCES units(id) |
2846
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
329 ); |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
330 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
331 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
332 CREATE SEQUENCE WATERLEVEL_DIFF_COLUMN_ID_SEQ; |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
333 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
334 CREATE TABLE waterlevel_difference_column ( |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
335 id NUMBER(38,0) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
336 difference_id NUMBER(38,0) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
337 description VARCHAR(256), |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
338 PRIMARY KEY (id), |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
339 CONSTRAINT fk_wdc_difference_id FOREIGN KEY (difference_id) REFERENCES waterlevel_difference (id) |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
340 ); |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
341 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
342 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
343 CREATE SEQUENCE WATERLEVEL_DIFF_VALUES_ID_SEQ; |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
344 |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
345 CREATE TABLE waterlevel_difference_values ( |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
346 id NUMBER(38,0) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
347 column_id NUMBER(38,0) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
348 station NUMBER(38,3) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
349 value NUMBER(38,2) NOT NULL, |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
350 PRIMARY KEY (id), |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
351 CONSTRAINT fk_wdv_column_id FOREIGN KEY (column_id) REFERENCES waterlevel_difference_column (id) |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
352 ); |
c1c6c9190636
Improved the db schema to store MINFO specific waterlevel differences.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2844
diff
changeset
|
353 |