diff flys-backend/doc/schema/oracle-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 3d8000616ed5
children a9658d43b621
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Thu Feb 28 17:12:46 2013 +0100
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Thu Feb 28 18:04:19 2013 +0100
@@ -1,11 +1,20 @@
 WHENEVER SQLERROR EXIT;
+
+CREATE TABLE axis_kinds(
+    id NUMBER PRIMARY KEY NOT NULL,
+    name VARCHAR(64)
+);
+INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (0, 'Unbekannt');
+INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (1, 'Aktuell');
+INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (2, 'Sonstige');
+
 -- Geodaesie/Flussachse+km/achse
 CREATE SEQUENCE RIVER_AXES_ID_SEQ;
 CREATE TABLE river_axes(
     OGR_FID NUMBER(38),
     GEOM MDSYS.SDO_GEOMETRY,
     river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
-    kind     NUMBER(38) DEFAULT 0 NOT NULL,
+    kind_id  NUMBER(38) REFERENCES axis_kinds(id) NOT NULL,
     name     VARCHAR(64),
     path     VARCHAR(256),
     ID NUMBER PRIMARY KEY NOT NULL

http://dive4elements.wald.intevation.org