comparison 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
comparison
equal deleted inserted replaced
5223:54f2a56752a1 5224:2594904640c3
330 PRIMARY KEY (id) 330 PRIMARY KEY (id)
331 ); 331 );
332 332
333 333
334 -- WSTS 334 -- WSTS
335 --lookup table for wst kinds
336 CREATE TABLE wst_kinds (
337 id NUMBER PRIMARY KEY NOT NULL,
338 kind VARCHAR(64) NOT NULL
339 );
340 INSERT INTO wst_kinds (id, kind) VALUES (0, 'basedata');
341 INSERT INTO wst_kinds (id, kind) VALUES (1, 'basedata_additionals_marks');
342 INSERT INTO wst_kinds (id, kind) VALUES (2, 'basedata_fixations_wst');
343 INSERT INTO wst_kinds (id, kind) VALUES (3, 'basedata_officials');
344 INSERT INTO wst_kinds (id, kind) VALUES (4, 'basedata_heightmarks-points-relative_points');
345 INSERT INTO wst_kinds (id, kind) VALUES (5, 'basedata_flood-protections_relative_points');
346 INSERT INTO wst_kinds (id, kind) VALUES (6, 'morpho_waterlevel-differences');
347 INSERT INTO wst_kinds (id, kind) VALUES (7, 'morpho_waterlevels');
348
349
335 CREATE SEQUENCE WSTS_ID_SEQ; 350 CREATE SEQUENCE WSTS_ID_SEQ;
336 351
337 CREATE TABLE wsts ( 352 CREATE TABLE wsts (
338 id NUMBER(38,0) NOT NULL, 353 id NUMBER(38,0) NOT NULL,
339 description VARCHAR2(255), 354 description VARCHAR2(255),
376 ALTER TABLE wst_column_q_ranges ADD CONSTRAINT cWstColumnQRangesWstQRanges FOREIGN KEY (wst_q_range_id) REFERENCES wst_q_ranges ON DELETE CASCADE; 391 ALTER TABLE wst_column_q_ranges ADD CONSTRAINT cWstColumnQRangesWstQRanges FOREIGN KEY (wst_q_range_id) REFERENCES wst_q_ranges ON DELETE CASCADE;
377 ALTER TABLE wst_columns ADD CONSTRAINT cWstColumnsWsts FOREIGN KEY (wst_id) REFERENCES wsts ON DELETE CASCADE; 392 ALTER TABLE wst_columns ADD CONSTRAINT cWstColumnsWsts FOREIGN KEY (wst_id) REFERENCES wsts ON DELETE CASCADE;
378 ALTER TABLE wst_column_values ADD CONSTRAINT cWstColumnValuesWstColumns FOREIGN KEY (wst_column_id) REFERENCES wst_columns ON DELETE CASCADE; 393 ALTER TABLE wst_column_values ADD CONSTRAINT cWstColumnValuesWstColumns FOREIGN KEY (wst_column_id) REFERENCES wst_columns ON DELETE CASCADE;
379 ALTER TABLE wst_q_ranges ADD CONSTRAINT cWstQRangesRanges FOREIGN KEY (range_id) REFERENCES RANGES ON DELETE CASCADE; 394 ALTER TABLE wst_q_ranges ADD CONSTRAINT cWstQRangesRanges FOREIGN KEY (range_id) REFERENCES RANGES ON DELETE CASCADE;
380 ALTER TABLE wsts ADD CONSTRAINT cWstsRivers FOREIGN KEY (river_id) REFERENCES rivers ON DELETE CASCADE; 395 ALTER TABLE wsts ADD CONSTRAINT cWstsRivers FOREIGN KEY (river_id) REFERENCES rivers ON DELETE CASCADE;
396 ALTER TABLE wsts ADD CONSTRAINT cWstsWstKinds FOREIGN KEY (kind) REFERENCES wst_kinds;
381 397
382 -- VIEWS 398 -- VIEWS
383 399
384 CREATE VIEW wst_value_table AS 400 CREATE VIEW wst_value_table AS
385 SELECT wcv.position AS position, 401 SELECT wcv.position AS position,

http://dive4elements.wald.intevation.org