Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql Mon Mar 25 17:01:07 2013 +0100 +++ b/flys-backend/doc/schema/oracle-spatial.sql Mon Mar 25 17:51:33 2013 +0100 @@ -412,3 +412,22 @@ SELECT JETTIES_ID_SEQ.nextval INTO :new.id FROM dual; END; / + +CREATE SEQUENCE FLOOD_MARKS_ID_SEQ; +CREATE TABLE flood_marks ( + OGR_FID NUMBER(38), + GEOM MDSYS.SDO_GEOMETRY, + id NUMBER PRIMARY KEY NOT NULL, + river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE, + path VARCHAR(256), + km NUMBER(7,3), + z NUMBER(38,12), + location VARCHAR(64), + year NUMBER(38,0) +); +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); +CREATE OR REPLACE TRIGGER flood_marks_trigger BEFORE INSERT ON flood_marks FOR EACH ROW + BEGIN + SELECT FLOOD_MARKS_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/