comparison flys-backend/ChangeLog @ 1209:c12b5fbd33e8

schema: Added structures for HYKs "Hydraulische Kenngroessen" flys-backend/trunk@2335 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 15 Jul 2011 09:36:23 +0000
parents 2b57edd94735
children 31d8638760b1
comparison
equal deleted inserted replaced
1208:2b57edd94735 1209:c12b5fbd33e8
1 2011-07-15 Sascha L. Teichmann <sascha.teichmann@intevation.de>
2
3 * doc/schema/postgresql.sql: Added structures for HYKs "Hydraulische Kenngroessen"
4 To update existing databases:
5
6 BEGIN;
7 CREATE SEQUENCE HYKS_ID_SEQ;
8
9 CREATE TABLE hyks (
10 id int PRIMARY KEY NOT NULL,
11 river_id int NOT NULL,
12 description VARCHAR(256) NOT NULL
13 );
14
15 CREATE SEQUENCE HYK_ENTRIES_ID_SEQ;
16
17 CREATE TABLE hyk_entries (
18 id int PRIMARY KEY NOT NULL,
19 hyk_id int NOT NULL REFERENCES hyks(id),
20 km NUMERIC NOT NULL,
21 UNIQUE (hyk_id, km)
22 );
23
24 CREATE SEQUENCE HYK_FORMATIONS_ID_SEQ;
25
26 CREATE TABLE hyk_formations (
27 id int PRIMARY KEY NOT NULL,
28 formation_num int NOT NULL DEFAULT 0,
29 hyk_entry_id int NOT NULL REFERENCES hyk_entries(id),
30 top NUMERIC NOT NULL,
31 bottom NUMERIC NOT NULL,
32 UNIQUE (hyk_entry_id, formation_num)
33 );
34
35 CREATE SEQUENCE HYK_FLOW_ZONE_TYPES_ID_SEQ;
36
37 CREATE TABLE hyk_flow_zone_types (
38 id int PRIMARY KEY NOT NULL,
39 name VARCHAR(50) NOT NULL UNIQUE,
40 description VARCHAR(256)
41 );
42
43 CREATE SEQUENCE HYK_FLOW_ZONES_ID_SEQ;
44
45 CREATE TABLE hyk_flow_zones (
46 id int PRIMARY KEY NOT NULL,
47 formation_id int NOT NULL REFERENCES hyk_formations(id),
48 type_id int NOT NULL REFERENCES hyk_flow_zone_types(id),
49 a NUMERIC NOT NULL,
50 b NUMERIC NOT NULL,
51 CHECK (a <= b)
52 );
53 COMMIT;
54
1 2011-07-13 Sascha L. Teichmann <sascha.teichmann@intevation.de> 55 2011-07-13 Sascha L. Teichmann <sascha.teichmann@intevation.de>
2 56
3 * pom.xml: Bumped Hibernate up to 3.6.5. 57 * pom.xml: Bumped Hibernate up to 3.6.5.
4 58
5 2011-07-11 Sascha L. Teichmann <sascha.teichmann@intevation.de> 59 2011-07-11 Sascha L. Teichmann <sascha.teichmann@intevation.de>

http://dive4elements.wald.intevation.org