diff flys-backend/doc/schema/oracle-spatial.sql @ 5385:2da74705c29d

Scheme change: Building table is extended and got a lookup table for kind
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 22 Mar 2013 17:30:10 +0100
parents 59f9760e8b7f
children e65fee5ea98a
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Fri Mar 22 17:00:22 2013 +0100
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Fri Mar 22 17:30:10 2013 +0100
@@ -77,13 +77,25 @@
 --CREATE INDEX CrossSectionTracks_spatial_idx ON cross_section_tracks(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
 
 
--- Geodaesie/Bauwerke/Wehre.shp
+CREATE TABLE building_kinds(
+    id NUMBER PRIMARY KEY NOT NULL,
+    name VARCHAR(64)
+);
+INSERT INTO building_kinds(id, name) VALUES (0, 'Sonstige');
+INSERT INTO building_kinds(id, name) VALUES (1, 'Brücken');
+INSERT INTO building_kinds(id, name) VALUES (2, 'Wehre');
+INSERT INTO building_kinds(id, name) VALUES (3, 'Pegel');
+
+-- Geodaesie/Bauwerke
 CREATE SEQUENCE BUILDINGS_ID_SEQ;
 CREATE TABLE buildings(
     OGR_FID NUMBER(38),
     GEOM MDSYS.SDO_GEOMETRY,
     river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
-    name VARCHAR2(255),
+    kind_id NUMBER(38) REFERENCES building_kinds(id) NOT NULL DEFAULT 0,
+    station NUMBER(38,11) NOT NULL,
+    name VARCHAR2(255), -- The layername
+    description VARCHAR(256), -- Name taken from attributes
     path     VARCHAR(256),
     ID NUMBER PRIMARY KEY NOT NULL
 );

http://dive4elements.wald.intevation.org