Mercurial > dive4elements > river
comparison backend/doc/schema/oracle.sql @ 6030:d12f920bbf00
Schema change: Add missing constraints to cross sections in Oracle, cosmetics
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 16 May 2013 16:14:28 +0200 |
parents | d9a1cf0438a5 |
children | 176664f84d86 |
comparison
equal
deleted
inserted
replaced
6029:f9c5e1a8032d | 6030:d12f920bbf00 |
---|---|
35 -- CROSS_SECTION_LINES | 35 -- CROSS_SECTION_LINES |
36 CREATE SEQUENCE CROSS_SECTION_LINES_ID_SEQ; | 36 CREATE SEQUENCE CROSS_SECTION_LINES_ID_SEQ; |
37 | 37 |
38 CREATE TABLE cross_section_lines ( | 38 CREATE TABLE cross_section_lines ( |
39 id NUMBER(38,0) NOT NULL, | 39 id NUMBER(38,0) NOT NULL, |
40 km NUMBER(38,2), | 40 km NUMBER(38,2) NOT NULL, |
41 cross_section_id NUMBER(38,0), | 41 cross_section_id NUMBER(38,0) NOT NULL, |
42 PRIMARY KEY (id) | 42 PRIMARY KEY (id), |
43 UNIQUE (km, cross_section_id) | |
43 ); | 44 ); |
44 | 45 |
45 | 46 |
46 -- CROSS_SECTION_POINTS | 47 -- CROSS_SECTION_POINTS |
47 CREATE SEQUENCE CROSS_SECTION_POINTS_ID_SEQ; | 48 CREATE SEQUENCE CROSS_SECTION_POINTS_ID_SEQ; |
48 | 49 |
49 CREATE TABLE cross_section_points ( | 50 CREATE TABLE cross_section_points ( |
50 id NUMBER(38,0) NOT NULL, | 51 id NUMBER(38,0) NOT NULL, |
51 col_pos NUMBER(38,0), | 52 col_pos NUMBER(38,0) NOT NULL, |
52 x NUMBER(38,2), | 53 x NUMBER(38,2) NOT NULL, |
53 y NUMBER(38,2), | 54 y NUMBER(38,2) NOT NULL, |
54 cross_section_line_id NUMBER(38,0), | 55 cross_section_line_id NUMBER(38,0) NOT NULL, |
55 PRIMARY KEY (id) | 56 PRIMARY KEY (id), |
57 UNIQUE (cross_section_line_id, col_pos) | |
56 ); | 58 ); |
57 | 59 |
58 | 60 |
59 -- CROSS_SECTIONS | 61 -- CROSS_SECTIONS |
60 CREATE SEQUENCE CROSS_SECTIONS_ID_SEQ; | 62 CREATE SEQUENCE CROSS_SECTIONS_ID_SEQ; |
61 | 63 |
62 CREATE TABLE cross_sections ( | 64 CREATE TABLE cross_sections ( |
63 id NUMBER(38,0) NOT NULL, | 65 id NUMBER(38,0) NOT NULL, |
64 description VARCHAR2(255), | 66 description VARCHAR2(255), |
65 river_id NUMBER(38,0), | 67 river_id NUMBER(38,0) NOT NULL, |
66 time_interval_id NUMBER(38,0), | 68 time_interval_id NUMBER(38,0), |
67 PRIMARY KEY (id) | 69 PRIMARY KEY (id) |
68 ); | 70 ); |
69 | 71 |
70 -- Indices for faster access of the points | 72 -- Indices for faster access of the points |