diff 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
line wrap: on
line diff
--- a/backend/doc/schema/oracle.sql	Thu May 16 12:34:23 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Thu May 16 16:14:28 2013 +0200
@@ -37,9 +37,10 @@
 
 CREATE TABLE cross_section_lines (
     id                  NUMBER(38,0) NOT NULL,
-    km                  NUMBER(38,2),
-    cross_section_id    NUMBER(38,0), 
-    PRIMARY KEY         (id)
+    km                  NUMBER(38,2) NOT NULL,
+    cross_section_id    NUMBER(38,0) NOT NULL, 
+    PRIMARY KEY         (id),
+    UNIQUE (km, cross_section_id)
 );
 
 
@@ -48,11 +49,12 @@
 
 CREATE TABLE cross_section_points (
     id                      NUMBER(38,0) NOT NULL,
-    col_pos                 NUMBER(38,0),
-    x                       NUMBER(38,2),
-    y                       NUMBER(38,2),
-    cross_section_line_id   NUMBER(38,0),
-    PRIMARY KEY             (id)
+    col_pos                 NUMBER(38,0) NOT NULL,
+    x                       NUMBER(38,2) NOT NULL,
+    y                       NUMBER(38,2) NOT NULL,
+    cross_section_line_id   NUMBER(38,0) NOT NULL,
+    PRIMARY KEY             (id),
+    UNIQUE (cross_section_line_id, col_pos)
 );
 
 
@@ -62,7 +64,7 @@
 CREATE TABLE cross_sections (
     id                  NUMBER(38,0) NOT NULL,
     description         VARCHAR2(255),
-    river_id            NUMBER(38,0),
+    river_id            NUMBER(38,0) NOT NULL,
     time_interval_id    NUMBER(38,0),
     PRIMARY KEY         (id)
 );

http://dive4elements.wald.intevation.org