diff flys-backend/doc/schema/oracle.sql @ 5224:2594904640c3

SCHEMA CHANGE: analogue r5201. Here for Oracle
author Tom Gottfried <tom@intevation.de>
date Mon, 11 Mar 2013 18:17:12 +0100
parents 2919cdc4e858
children 4f3cc1aebcc0
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle.sql	Mon Mar 11 17:25:18 2013 +0100
+++ b/flys-backend/doc/schema/oracle.sql	Mon Mar 11 18:17:12 2013 +0100
@@ -332,6 +332,21 @@
 
 
 -- WSTS
+--lookup table for wst kinds
+CREATE TABLE wst_kinds (
+    id 	     NUMBER PRIMARY KEY NOT NULL,
+    kind     VARCHAR(64) NOT NULL
+);
+INSERT INTO wst_kinds (id, kind) VALUES (0, 'basedata');
+INSERT INTO wst_kinds (id, kind) VALUES (1, 'basedata_additionals_marks');
+INSERT INTO wst_kinds (id, kind) VALUES (2, 'basedata_fixations_wst');
+INSERT INTO wst_kinds (id, kind) VALUES (3, 'basedata_officials');
+INSERT INTO wst_kinds (id, kind) VALUES (4, 'basedata_heightmarks-points-relative_points');
+INSERT INTO wst_kinds (id, kind) VALUES (5, 'basedata_flood-protections_relative_points');
+INSERT INTO wst_kinds (id, kind) VALUES (6, 'morpho_waterlevel-differences');
+INSERT INTO wst_kinds (id, kind) VALUES (7, 'morpho_waterlevels');
+
+
 CREATE SEQUENCE WSTS_ID_SEQ;
 
 CREATE TABLE wsts (
@@ -378,6 +393,7 @@
 ALTER TABLE wst_column_values ADD CONSTRAINT cWstColumnValuesWstColumns FOREIGN KEY (wst_column_id) REFERENCES wst_columns ON DELETE CASCADE;
 ALTER TABLE wst_q_ranges ADD CONSTRAINT cWstQRangesRanges FOREIGN KEY (range_id) REFERENCES RANGES ON DELETE CASCADE;
 ALTER TABLE wsts ADD CONSTRAINT cWstsRivers FOREIGN KEY (river_id) REFERENCES rivers ON DELETE CASCADE;
+ALTER TABLE wsts ADD CONSTRAINT cWstsWstKinds FOREIGN KEY (kind) REFERENCES wst_kinds;
 
 -- VIEWS
 

http://dive4elements.wald.intevation.org