comparison flys-backend/doc/schema/oracle-spatial.sql @ 5210:908848b74d7e

SCHEME CHANGE: dgm now uses time intervals and ranges
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 08 Mar 2013 18:15:48 +0100
parents 31fd42400c84
children b46df0609276
comparison
equal deleted inserted replaced
5209:850237ae9544 5210:908848b74d7e
128 END; 128 END;
129 / 129 /
130 --CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON'); 130 --CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');
131 131
132 132
133 -- TODO: Test-Me. Fix Importer-Skript.
134 -- NOTE: It's not a spatial schema!
135 -- Geodaesie/Hoehenmodelle/* 133 -- Geodaesie/Hoehenmodelle/*
136 CREATE SEQUENCE DEM_ID_SEQ; 134 CREATE SEQUENCE DEM_ID_SEQ;
137 CREATE TABLE dem ( 135 CREATE TABLE dem (
138 ID NUMBER PRIMARY KEY NOT NULL, 136 ID NUMBER PRIMARY KEY NOT NULL,
139 river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE, 137 river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE,
140 -- XXX Should we use the ranges table instead? 138 name VARCHAR(64),
141 name VARCHAR(64), 139 range_id NUMBER(38) REFERENCES ranges(id);
142 lower NUMBER(19,5), 140 time_interval_id NUMBER(38) REFERENCES time_intervals(id),
143 upper NUMBER(19,5), 141 projection VARCHAR(32),
144 year_from VARCHAR(32), 142 elevation_state VARCHAR(32),
145 year_to VARCHAR(32), 143 srid NUMBER NOT NULL,
146 projection VARCHAR(32), 144 format VARCHAR(32),
147 elevation_state VARCHAR(32), 145 border_break NUMBER(1) DEFAULT 0 NOT NULL,
148 srid NUMBER NOT NULL, 146 resolution VARCHAR(16),
149 format VARCHAR(32), 147 description VARCHAR(256),
150 border_break NUMBER(1) DEFAULT 0 NOT NULL, 148 path VARCHAR(256) NOT NULL UNIQUE
151 resolution VARCHAR(16),
152 description VARCHAR(256),
153 path VARCHAR(256) NOT NULL UNIQUE
154 ); 149 );
155 CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW 150 CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW
156 BEGIN 151 BEGIN
157 SELECT DEM_ID_SEQ.nextval INTO :new.id FROM dual; 152 SELECT DEM_ID_SEQ.nextval INTO :new.id FROM dual;
158 END; 153 END;

http://dive4elements.wald.intevation.org