diff flys-backend/doc/schema/postgresql-spatial.sql @ 5146:d4fdd98a04f7

Add kind_id to river_axes table and add AxisKind object to model There are currently three kinds: 0 for unkown, 1 for current, 2 for everything else. Only current is used for calculation
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 28 Feb 2013 18:04:19 +0100
parents 04eb62eae722
children a9658d43b621
line wrap: on
line diff
--- a/flys-backend/doc/schema/postgresql-spatial.sql	Thu Feb 28 17:12:46 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-spatial.sql	Thu Feb 28 18:04:19 2013 +0100
@@ -1,11 +1,19 @@
 BEGIN;
 
+CREATE TABLE axis_kinds(
+    id int PRIMARY KEY NOT NULL,
+    name VARCHAR(64)
+);
+INSERT INTO axis_kinds(id, name) VALUES (0, 'Unbekannt');
+INSERT INTO axis_kinds(id, name) VALUES (1, 'Aktuell');
+INSERT INTO axis_kinds(id, name) VALUES (2, 'Sonstige');
+
 -- Geodaesie/Flussachse+km/achse
 CREATE SEQUENCE RIVER_AXES_ID_SEQ;
 CREATE TABLE river_axes (
     id       int PRIMARY KEY NOT NULL,
     river_id int REFERENCES rivers(id) ON DELETE CASCADE,
-    kind     int             NOT NULL DEFAULT 0,
+    kind_id  int REFERENCES axis_kinds(id) NOT NULL DEFAULT 0,
     name     VARCHAR(64),
     path     VARCHAR(256)
 );

http://dive4elements.wald.intevation.org