Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-spatial.sql @ 5146:d4fdd98a04f7
Add kind_id to river_axes table and add AxisKind object to model
There are currently three kinds: 0 for unkown, 1 for current,
2 for everything else.
Only current is used for calculation
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 18:04:19 +0100 |
parents | 3d8000616ed5 |
children | a9658d43b621 |
comparison
equal
deleted
inserted
replaced
5145:801175535406 | 5146:d4fdd98a04f7 |
---|---|
1 WHENEVER SQLERROR EXIT; | 1 WHENEVER SQLERROR EXIT; |
2 | |
3 CREATE TABLE axis_kinds( | |
4 id NUMBER PRIMARY KEY NOT NULL, | |
5 name VARCHAR(64) | |
6 ); | |
7 INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (0, 'Unbekannt'); | |
8 INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (1, 'Aktuell'); | |
9 INSERT INTO axis_kinds(id, name, use_for_caclulation) VALUES (2, 'Sonstige'); | |
10 | |
2 -- Geodaesie/Flussachse+km/achse | 11 -- Geodaesie/Flussachse+km/achse |
3 CREATE SEQUENCE RIVER_AXES_ID_SEQ; | 12 CREATE SEQUENCE RIVER_AXES_ID_SEQ; |
4 CREATE TABLE river_axes( | 13 CREATE TABLE river_axes( |
5 OGR_FID NUMBER(38), | 14 OGR_FID NUMBER(38), |
6 GEOM MDSYS.SDO_GEOMETRY, | 15 GEOM MDSYS.SDO_GEOMETRY, |
7 river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE, | 16 river_id NUMBER(38) REFERENCES rivers(id) ON DELETE CASCADE, |
8 kind NUMBER(38) DEFAULT 0 NOT NULL, | 17 kind_id NUMBER(38) REFERENCES axis_kinds(id) NOT NULL, |
9 name VARCHAR(64), | 18 name VARCHAR(64), |
10 path VARCHAR(256), | 19 path VARCHAR(256), |
11 ID NUMBER PRIMARY KEY NOT NULL | 20 ID NUMBER PRIMARY KEY NOT NULL |
12 ); | 21 ); |
13 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); | 22 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); |