changeset 7005:dddf633fec05 double-precision

SCHEMA CHANGE: a < b now enforced on ranges.
author Tom Gottfried <tom.gottfried@intevation.de>
date Thu, 12 Sep 2013 21:12:59 +0200
parents bb5bd48b80f6
children 28748bb1b676
files backend/doc/schema/oracle.sql backend/doc/schema/postgresql.sql
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/backend/doc/schema/oracle.sql	Thu Sep 12 19:15:07 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Thu Sep 12 21:12:59 2013 +0200
@@ -251,7 +251,8 @@
     b                   NUMBER(38,10),
     river_id            NUMBER(38,0),
     UNIQUE (river_id, a, b),
-    PRIMARY KEY (id)
+    PRIMARY KEY (id),
+    CHECK (a < b)
 );
 
 
--- a/backend/doc/schema/postgresql.sql	Thu Sep 12 19:15:07 2013 +0200
+++ b/backend/doc/schema/postgresql.sql	Thu Sep 12 21:12:59 2013 +0200
@@ -34,7 +34,8 @@
     river_id int             NOT NULL REFERENCES rivers(id) ON DELETE CASCADE,
     a        NUMERIC         NOT NULL,
     b        NUMERIC,
-    UNIQUE (river_id, a, b)
+    UNIQUE (river_id, a, b),
+    CHECK (a < b)
 );
 
 

http://dive4elements.wald.intevation.org