comparison flys-backend/doc/schema/postgresql.sql @ 167:15d515fe15f5

Added POJOs to be mapped to schema. flys-backend/trunk@1456 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 10 Mar 2011 13:44:51 +0000
parents 324e12ab7a05
children 86a1bd9cc50e
comparison
equal deleted inserted replaced
166:56eb8f1b42cf 167:15d515fe15f5
47 -- Pegelnullpunkt 47 -- Pegelnullpunkt
48 datum NUMERIC NOT NULL, 48 datum NUMERIC NOT NULL,
49 -- Streckengueltigkeit 49 -- Streckengueltigkeit
50 range_id int NOT NULL REFERENCES ranges (id), 50 range_id int NOT NULL REFERENCES ranges (id),
51 51
52 UNIQUE (name, river_id) 52 UNIQUE (name, river_id),
53 UNIQUE (river_id, datum)
53 ); 54 );
54 55
55 -- Type of a Hauptwert 'W', 'Q', 'D', etc. 56 -- Type of a Hauptwert 'W', 'Q', 'D', etc.
56 CREATE TABLE main_value_types ( 57 CREATE TABLE main_value_types (
57 id int PRIMARY KEY NOT NULL, 58 id int PRIMARY KEY NOT NULL,
86 -- TODO: better checks 87 -- TODO: better checks
87 UNIQUE (gauge_id, named_value_id, time_interval_id) 88 UNIQUE (gauge_id, named_value_id, time_interval_id)
88 ); 89 );
89 90
90 -- Abflusstafeln 91 -- Abflusstafeln
91 CREATE TABLE discharge_table ( 92 CREATE TABLE discharge_tables (
92 id int PRIMARY KEY NOT NULL, 93 id int PRIMARY KEY NOT NULL,
93 gauge_id int NOT NULL REFERENCES gauges(id), 94 gauge_id int NOT NULL REFERENCES gauges(id),
94 95
95 time_interval_id int REFERENCES time_intervals(id), 96 time_interval_id int REFERENCES time_intervals(id),
96 97
99 ); 100 );
100 101
101 -- Values of the Abflusstafeln 102 -- Values of the Abflusstafeln
102 CREATE TABLE discharge_table_values ( 103 CREATE TABLE discharge_table_values (
103 id int PRIMARY KEY NOT NULL, 104 id int PRIMARY KEY NOT NULL,
104 table_id int NOT NULL REFERENCES discharge_table(id), 105 table_id int NOT NULL REFERENCES discharge_tables(id),
105 q NUMERIC NOT NULL, 106 q NUMERIC NOT NULL,
106 w NUMERIC NOT NULL, 107 w NUMERIC NOT NULL,
107 108
108 UNIQUE (table_id, q, w) 109 UNIQUE (table_id, q, w)
109 ); 110 );

http://dive4elements.wald.intevation.org