Mercurial > dive4elements > river
comparison backend/doc/schema/postgresql-minfo.sql @ 7839:3f6b9fae1637
Added tables for porosity and porosity values to postgres schema.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 30 Apr 2014 14:09:53 +0200 |
parents | 5b5a2cc8210f |
children | a88e308567a1 |
comparison
equal
deleted
inserted
replaced
7820:6b880df95a3a | 7839:3f6b9fae1637 |
---|---|
142 density NUMERIC NOT NULL, | 142 density NUMERIC NOT NULL, |
143 description VARCHAR(256), | 143 description VARCHAR(256), |
144 year int, | 144 year int, |
145 PRIMARY KEY(id), | 145 PRIMARY KEY(id), |
146 CONSTRAINT fk_sdv_sediment_density_id FOREIGN KEY(sediment_density_id) REFERENCES sediment_density(id) ON DELETE CASCADE | 146 CONSTRAINT fk_sdv_sediment_density_id FOREIGN KEY(sediment_density_id) REFERENCES sediment_density(id) ON DELETE CASCADE |
147 ); | |
148 | |
149 | |
150 CREATE SEQUENCE POROSITY_ID_SEQ; | |
151 | |
152 CREATE TABLE porosity ( | |
153 id int NOT NULL, | |
154 river_id int NOT NULL, | |
155 depth_id int NOT NULL, | |
156 description VARCHAR(256), | |
157 time_interval_id int NOT NULL, | |
158 PRIMARY KEY(id), | |
159 CONSTRAINT fk_p_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, | |
160 CONSTRAINT fk_p_depth_id FOREIGN KEY (depth_id) REFERENCES depths(id), | |
161 CONSTRAINT fk_p_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id) | |
162 ); | |
163 | |
164 | |
165 CREATE SEQUENCE POROSITY_VALUES_ID_SEQ; | |
166 | |
167 CREATE TABLE porosity_values ( | |
168 id int NOT NULL, | |
169 porosity_id int NOT NULL, | |
170 station NUMERIC NOT NULL, | |
171 shore_offset NUMERIC, | |
172 porosity NUMERIC NOT NULL, | |
173 description VARCHAR(256), | |
174 PRIMARY KEY(id), | |
175 CONSTRAINT fk_pv_porosity_id FOREIGN KEY(porosity_id) REFERENCES porosity(id) ON DELETE CASCADE | |
147 ); | 176 ); |
148 | 177 |
149 | 178 |
150 CREATE SEQUENCE MORPHOLOGIC_WIDTH_ID_SEQ; | 179 CREATE SEQUENCE MORPHOLOGIC_WIDTH_ID_SEQ; |
151 | 180 |