comparison flys-backend/doc/schema/postgresql.sql @ 763:8076f6a689d0

First part of flys/issue18 flys-backend/trunk@2124 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 15 Jun 2011 09:22:00 +0000
parents bf16268629d9
children 5f8444df19e4
comparison
equal deleted inserted replaced
762:23fe9ac1c3b4 763:8076f6a689d0
41 41
42 CREATE TABLE edges ( 42 CREATE TABLE edges (
43 id int PRIMARY KEY NOT NULL, 43 id int PRIMARY KEY NOT NULL,
44 top NUMERIC, 44 top NUMERIC,
45 bottom NUMERIC 45 bottom NUMERIC
46 );
47
48 -- Types of annotatations (Hafen, Bruecke, Zufluss, ...)
49 CREATE SEQUENCE ANNOTATION_TYPES_ID_SEQ;
50
51 CREATE TABLE annotation_types (
52 id int PRIMARY KEY NOT NULL,
53 name VARCHAR(256) NOT NULL UNIQUE
46 ); 54 );
47 55
48 -- Some object (eg. Hafen) at a segment of river 56 -- Some object (eg. Hafen) at a segment of river
49 -- plus its position. 57 -- plus its position.
50 CREATE SEQUENCE ANNOTATIONS_ID_SEQ; 58 CREATE SEQUENCE ANNOTATIONS_ID_SEQ;
52 CREATE TABLE annotations ( 60 CREATE TABLE annotations (
53 id int PRIMARY KEY NOT NULL, 61 id int PRIMARY KEY NOT NULL,
54 range_id int NOT NULL REFERENCES ranges(id), 62 range_id int NOT NULL REFERENCES ranges(id),
55 attribute_id int NOT NULL REFERENCES attributes(id), 63 attribute_id int NOT NULL REFERENCES attributes(id),
56 position_id int REFERENCES positions(id), 64 position_id int REFERENCES positions(id),
57 edge_id int REFERENCES edges(id) 65 edge_id int REFERENCES edges(id),
66 type_id int REFERENCES annotation_types(id)
58 ); 67 );
59 68
60 -- Pegel 69 -- Pegel
61 CREATE SEQUENCE GAUGES_ID_SEQ; 70 CREATE SEQUENCE GAUGES_ID_SEQ;
62 71

http://dive4elements.wald.intevation.org