changeset 5748:b5553164fabf

Schema change: allow SECTIE and STROVOER (alias SOBEK) to be NULL, rename kinds
author Tom Gottfried <tom.gottfried@intevation.de>
date Wed, 17 Apr 2013 19:30:10 +0200
parents 09465f534c86
children 2cd8fcec3f00
files flys-backend/doc/schema/oracle-spatial.sql flys-backend/doc/schema/postgresql-spatial.sql
diffstat 2 files changed, 23 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Wed Apr 17 19:01:44 2013 +0200
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Wed Apr 17 19:30:10 2013 +0200
@@ -237,23 +237,23 @@
         SELECT HWS_LINES_ID_SEQ.nextval INTO :new.id FROM dual;
     END;
 /
--- HWS Points lookup tables
+
 CREATE TABLE sectie_kinds (
     id NUMBER PRIMARY KEY NOT NULL,
     name VARCHAR(64) NOT NULL
 );
-INSERT INTO sectie_kinds (id, name) VALUES (0, 'SECTIE Unbekannt');
-INSERT INTO sectie_kinds (id, name) VALUES (1, 'Flussschlauch');
-INSERT INTO sectie_kinds (id, name) VALUES (2, 'Uferbank');
-INSERT INTO sectie_kinds (id, name) VALUES (3, 'Überflutungsbereich');
+INSERT INTO sectie_kinds (id, name) VALUES (0, 'nicht berücksichtigt');
+INSERT INTO sectie_kinds (id, name) VALUES (1, 'Hauptgerinne');
+INSERT INTO sectie_kinds (id, name) VALUES (2, 'Uferbereich');
+INSERT INTO sectie_kinds (id, name) VALUES (3, 'Vorland');
 
 CREATE TABLE sobek_kinds (
     id NUMBER PRIMARY KEY NOT NULL,
     name VARCHAR(64) NOT NULL
 );
-INSERT INTO sobek_kinds (id, name) VALUES (0, 'SOBEK Unbekannt');
-INSERT INTO sobek_kinds (id, name) VALUES (1, 'Stromführend');
-INSERT INTO sobek_kinds (id, name) VALUES (2, 'Stromspeichernd');
+INSERT INTO sobek_kinds (id, name) VALUES (0, 'nicht berücksichtigt');
+INSERT INTO sobek_kinds (id, name) VALUES (1, 'durchströmt');
+INSERT INTO sobek_kinds (id, name) VALUES (2, 'nicht durchströmt');
 
 CREATE TABLE boundary_kinds (
     id NUMBER PRIMARY KEY NOT NULL,
@@ -338,8 +338,8 @@
     river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
     name VARCHAR(255),
     kind   NUMBER(38) DEFAULT 0 NOT NULL REFERENCES boundary_kinds(id),
-    sectie NUMBER(38) DEFAULT 0 NOT NULL REFERENCES sectie_kinds(id),
-    sobek  NUMBER(38) DEFAULT 0 NOT NULL REFERENCES sobek_kinds(id),
+    sectie NUMBER(38) REFERENCES sectie_kinds(id),
+    sobek  NUMBER(38) REFERENCES sobek_kinds(id),
     path     VARCHAR(256),
     id NUMBER PRIMARY KEY NOT NULL
 );
@@ -357,8 +357,8 @@
     river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
     name VARCHAR(255),
     kind   NUMBER(38) DEFAULT 0 NOT NULL REFERENCES boundary_kinds(id),
-    sectie NUMBER(38) DEFAULT 0 NOT NULL REFERENCES sectie_kinds(id),
-    sobek  NUMBER(38) DEFAULT 0 NOT NULL REFERENCES sobek_kinds(id),
+    sectie NUMBER(38) REFERENCES sectie_kinds(id),
+    sobek  NUMBER(38) REFERENCES sobek_kinds(id),
     path     VARCHAR(256),
     id NUMBER PRIMARY KEY NOT NULL
 );
--- a/flys-backend/doc/schema/postgresql-spatial.sql	Wed Apr 17 19:01:44 2013 +0200
+++ b/flys-backend/doc/schema/postgresql-spatial.sql	Wed Apr 17 19:30:10 2013 +0200
@@ -250,18 +250,18 @@
     id int PRIMARY KEY NOT NULL,
     name VARCHAR(64) NOT NULL
 );
-INSERT INTO sectie_kinds (id, name) VALUES (0, 'SECTIE Unbekannt');
-INSERT INTO sectie_kinds (id, name) VALUES (1, 'Flussschlauch');
-INSERT INTO sectie_kinds (id, name) VALUES (2, 'Uferbank');
-INSERT INTO sectie_kinds (id, name) VALUES (3, 'Überflutungsbereich');
+INSERT INTO sectie_kinds (id, name) VALUES (0, 'nicht berücksichtigt');
+INSERT INTO sectie_kinds (id, name) VALUES (1, 'Hauptgerinne');
+INSERT INTO sectie_kinds (id, name) VALUES (2, 'Uferbereich');
+INSERT INTO sectie_kinds (id, name) VALUES (3, 'Vorland');
 
 CREATE TABLE sobek_kinds (
     id int PRIMARY KEY NOT NULL,
     name VARCHAR(64) NOT NULL
 );
-INSERT INTO sobek_kinds (id, name) VALUES (0, 'SOBEK Unbekannt');
-INSERT INTO sobek_kinds (id, name) VALUES (1, 'Stromführend');
-INSERT INTO sobek_kinds (id, name) VALUES (2, 'Stromspeichernd');
+INSERT INTO sobek_kinds (id, name) VALUES (0, 'nicht berücksichtigt');
+INSERT INTO sobek_kinds (id, name) VALUES (1, 'durchströmt');
+INSERT INTO sobek_kinds (id, name) VALUES (2, 'nicht durchströmt');
 
 CREATE TABLE boundary_kinds (
     id int PRIMARY KEY NOT NULL,
@@ -278,8 +278,8 @@
     river_id   int REFERENCES rivers(id) ON DELETE CASCADE,
     name       VARCHAR(255),
     kind       int REFERENCES boundary_kinds(id) NOT NULL DEFAULT 0,
-    sectie     int REFERENCES sectie_kinds(id) NOT NULL DEFAULT 0,
-    sobek      int REFERENCES sobek_kinds(id) NOT NULL DEFAULT 0,
+    sectie     int REFERENCES sectie_kinds(id),
+    sobek      int REFERENCES sobek_kinds(id),
     path       VARCHAR(256)
 );
 SELECT AddGeometryColumn('hydr_boundaries','geom',31467,'MULTILINESTRING',3);
@@ -292,8 +292,8 @@
     river_id   int REFERENCES rivers(id) ON DELETE CASCADE,
     name       VARCHAR(255),
     kind       int REFERENCES boundary_kinds(id) NOT NULL DEFAULT 0,
-    sectie     int REFERENCES sectie_kinds(id) NOT NULL DEFAULT 0,
-    sobek      int REFERENCES sobek_kinds(id) NOT NULL DEFAULT 0,
+    sectie     int REFERENCES sectie_kinds(id),
+    sobek      int REFERENCES sobek_kinds(id),
     path       VARCHAR(256)
 );
 SELECT AddGeometryColumn('hydr_boundaries_poly','geom',31467,'MULTIPOLYGON',3);

http://dive4elements.wald.intevation.org