diff flys-backend/doc/schema/oracle.sql @ 5158:a9658d43b621

added missing constraints in schema (mostly for Oracle)
author Tom Gottfried <tom@intevation.de>
date Fri, 01 Mar 2013 13:28:45 +0100
parents 5c07ec3e9e25
children 8667f629d238
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle.sql	Fri Mar 01 12:40:15 2013 +0100
+++ b/flys-backend/doc/schema/oracle.sql	Fri Mar 01 13:28:45 2013 +0100
@@ -238,7 +238,7 @@
 
 CREATE TABLE ranges (
     id                  NUMBER(38,0) NOT NULL,
-    a                   NUMBER(38,10),
+    a                   NUMBER(38,10) NOT NULL,
     b                   NUMBER(38,10),
     river_id            NUMBER(38,0),
     PRIMARY KEY         (id)
@@ -261,11 +261,12 @@
 -- TIME_INTERVALS
 CREATE SEQUENCE TIME_INTERVALS_ID_SEQ;
 
-CREATE TABLE time_intervals (
+CREATE TABLE time_intervals_ (
     id                  NUMBER(38,0) NOT NULL, 
-    start_time          TIMESTAMP,
+    start_time          TIMESTAMP NOT NULL,
     stop_time           TIMESTAMP,
-    PRIMARY KEY         (id)
+    PRIMARY KEY         (id),
+    CHECK (start_time <= stop_time)
 );
 
 

http://dive4elements.wald.intevation.org