Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-spatial.sql @ 5409:8b29a94ebdd8
SCHEMA CHANGE: add table for flood marks and missing DROPs for jetties
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 25 Mar 2013 17:51:33 +0100 |
parents | 91f5908c472a |
children | 1488227b97b7 |
comparison
equal
deleted
inserted
replaced
5408:91f5908c472a | 5409:8b29a94ebdd8 |
---|---|
410 CREATE OR REPLACE TRIGGER jetties_trigger BEFORE INSERT ON jetties FOR EACH ROW | 410 CREATE OR REPLACE TRIGGER jetties_trigger BEFORE INSERT ON jetties FOR EACH ROW |
411 BEGIN | 411 BEGIN |
412 SELECT JETTIES_ID_SEQ.nextval INTO :new.id FROM dual; | 412 SELECT JETTIES_ID_SEQ.nextval INTO :new.id FROM dual; |
413 END; | 413 END; |
414 / | 414 / |
415 | |
416 CREATE SEQUENCE FLOOD_MARKS_ID_SEQ; | |
417 CREATE TABLE flood_marks ( | |
418 OGR_FID NUMBER(38), | |
419 GEOM MDSYS.SDO_GEOMETRY, | |
420 id NUMBER PRIMARY KEY NOT NULL, | |
421 river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE, | |
422 path VARCHAR(256), | |
423 km NUMBER(7,3), | |
424 z NUMBER(38,12), | |
425 location VARCHAR(64), | |
426 year NUMBER(38,0) | |
427 ); | |
428 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('flood_marks', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001)), 31467); | |
429 CREATE OR REPLACE TRIGGER flood_marks_trigger BEFORE INSERT ON flood_marks FOR EACH ROW | |
430 BEGIN | |
431 SELECT FLOOD_MARKS_ID_SEQ.nextval INTO :new.id FROM dual; | |
432 END; | |
433 / |