Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-spatial.sql @ 3951:89ada0b9083f
Modified the schema for DGMs; added converter for CSV to SQL for DGM information.
flys-backend/trunk@5604 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 27 Sep 2012 07:24:07 +0000 |
parents | c37effda3655 |
children | f5912365619c |
comparison
equal
deleted
inserted
replaced
3950:82e931f88137 | 3951:89ada0b9083f |
---|---|
153 CREATE SEQUENCE DEM_ID_SEQ; | 153 CREATE SEQUENCE DEM_ID_SEQ; |
154 CREATE TABLE dem ( | 154 CREATE TABLE dem ( |
155 ID NUMBER PRIMARY KEY NOT NULL, | 155 ID NUMBER PRIMARY KEY NOT NULL, |
156 river_id NUMBER(38), | 156 river_id NUMBER(38), |
157 -- XXX Should we use the ranges table instead? | 157 -- XXX Should we use the ranges table instead? |
158 lower NUMBER(19,5), | 158 name VARCHAR(64), |
159 upper NUMBER(19,5), | 159 lower NUMBER(19,5), |
160 path VARCHAR(256), | 160 upper NUMBER(19,5), |
161 UNIQUE (river_id, lower, upper) | 161 year_from NUMBER(38), |
162 year_to NUMBER(38), | |
163 projection VARCHAR(32), | |
164 elevation_state VARCHAR(32), | |
165 format VARCHAR(32), | |
166 border_break BOOLEAN NOT NULL DEFAULT FALSE, | |
167 resolution VARCHAR(16), | |
168 description VARCHAR(256), | |
169 path VARCHAR(256) | |
162 ); | 170 ); |
163 CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW | 171 CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW |
164 BEGIN | 172 BEGIN |
165 SELECT DEM_ID_SEQ.nextval INTO :new.id FROM dual; | 173 SELECT DEM_ID_SEQ.nextval INTO :new.id FROM dual; |
166 END; | 174 END; |