diff 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
line wrap: on
line diff
--- a/flys-backend/doc/schema/postgresql.sql	Tue Jun 14 17:30:09 2011 +0000
+++ b/flys-backend/doc/schema/postgresql.sql	Wed Jun 15 09:22:00 2011 +0000
@@ -45,6 +45,14 @@
     bottom NUMERIC
 );
 
+-- Types of annotatations (Hafen, Bruecke, Zufluss, ...)
+CREATE SEQUENCE ANNOTATION_TYPES_ID_SEQ;
+
+CREATE TABLE annotation_types (
+    id    int PRIMARY KEY NOT NULL,
+    name  VARCHAR(256)    NOT NULL UNIQUE
+);
+
 -- Some object (eg. Hafen) at a segment of river
 -- plus its position.
 CREATE SEQUENCE ANNOTATIONS_ID_SEQ;
@@ -54,7 +62,8 @@
     range_id     int             NOT NULL REFERENCES ranges(id),
     attribute_id int             NOT NULL REFERENCES attributes(id),
     position_id  int REFERENCES positions(id),
-    edge_id      int REFERENCES edges(id)
+    edge_id      int REFERENCES edges(id),
+    type_id      int REFERENCES annotation_types(id)
 );
 
 -- Pegel

http://dive4elements.wald.intevation.org