comparison backend/doc/schema/postgresql-minfo.sql @ 7981:45cced06490c facet-metadata

merged with default.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 30 Jun 2014 11:29:45 +0200
parents a88e308567a1
children bcb05a98bb3f
comparison
equal deleted inserted replaced
7894:42076d94977e 7981:45cced06490c
57 CONSTRAINT fk_old_elevation_model FOREIGN KEY (old_elevation_model_id) REFERENCES elevation_model(id), 57 CONSTRAINT fk_old_elevation_model FOREIGN KEY (old_elevation_model_id) REFERENCES elevation_model(id),
58 CONSTRAINT fk_range FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE 58 CONSTRAINT fk_range FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE
59 ); 59 );
60 60
61 61
62 CREATE SEQUENCE BED_HEIGHT_EPOCH_ID_SEQ;
63
64 CREATE TABLE bed_height_epoch (
65 id int NOT NULL,
66 river_id int NOT NULL,
67 time_interval_id int NOT NULL,
68 -- sounding_width int,
69 -- type_id int NOT NULL,
70 cur_elevation_model_id int NOT NULL,
71 old_elevation_model_id int,
72 range_id int,
73 evaluation_by VARCHAR(255),
74 description VARCHAR(255),
75 PRIMARY KEY(id),
76 CONSTRAINT fk_time_interval FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id),
77 CONSTRAINT fk_epoch_cur_elevation_model FOREIGN KEY (cur_elevation_model_id) REFERENCES elevation_model(id),
78 CONSTRAINT fk_epoch_old_elevation_model FOREIGN KEY (old_elevation_model_id) REFERENCES elevation_model(id),
79 CONSTRAINT fk_epoch_range FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE
80 );
81
82
83 CREATE SEQUENCE BED_SINGLE_VALUES_ID_SEQ; 62 CREATE SEQUENCE BED_SINGLE_VALUES_ID_SEQ;
84 63
85 CREATE TABLE bed_height_single_values ( 64 CREATE TABLE bed_height_single_values (
86 id int NOT NULL, 65 id int NOT NULL,
87 bed_height_single_id int NOT NULL, 66 bed_height_single_id int NOT NULL,
92 sounding_width NUMERIC, 71 sounding_width NUMERIC,
93 width NUMERIC, 72 width NUMERIC,
94 PRIMARY KEY(id), 73 PRIMARY KEY(id),
95 UNIQUE (station, bed_height_single_id), 74 UNIQUE (station, bed_height_single_id),
96 CONSTRAINT fk_bed_single_values_parent FOREIGN KEY (bed_height_single_id) REFERENCES bed_height_single(id) ON DELETE CASCADE 75 CONSTRAINT fk_bed_single_values_parent FOREIGN KEY (bed_height_single_id) REFERENCES bed_height_single(id) ON DELETE CASCADE
97 );
98
99
100 CREATE SEQUENCE BED_EPOCH_VALUES_ID_SEQ;
101
102 CREATE TABLE bed_height_epoch_values (
103 id int NOT NULL,
104 bed_height_epoch_id int NOT NULL,
105 station NUMERIC NOT NULL,
106 height NUMERIC,
107 PRIMARY KEY(id),
108 CONSTRAINT fk_bed_epoch_values_parent FOREIGN KEY (bed_height_epoch_id) REFERENCES bed_height_epoch(id) ON DELETE CASCADE
109 ); 76 );
110 77
111 78
112 CREATE SEQUENCE DEPTHS_ID_SEQ; 79 CREATE SEQUENCE DEPTHS_ID_SEQ;
113 80

http://dive4elements.wald.intevation.org