diff backend/doc/schema/oracle.sql @ 5894:62e6598a2c4b

Schema change: make gauges.official_number unique per river as we can have multiple identical gauges for different representations of the same river. Comments and TODOs
author Tom Gottfried <tom@intevation.de>
date Fri, 03 May 2013 10:31:34 +0200
parents c1abd48a03e2
children 39cf5d4acf5d
line wrap: on
line diff
--- a/backend/doc/schema/oracle.sql	Fri May 03 07:47:15 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Fri May 03 10:31:34 2013 +0200
@@ -121,12 +121,13 @@
     datum               NUMBER(38,2) NOT NULL, 
     name                VARCHAR2(255) NOT NULL,
     station             NUMBER(38,2) NOT NULL,
-    official_number     NUMBER(38,0) UNIQUE,
+    official_number     NUMBER(38,0),
     range_id            NUMBER(38,0) NOT NULL,
-    -- remove river id here because range_id references river already
+    -- TODO: remove river id here because range_id references river already
     river_id            NUMBER(38,0) NOT NULL,
     PRIMARY KEY         (id),
     UNIQUE (name, river_id),
+    UNIQUE (official_number, river_id),
     UNIQUE (river_id, station)
 );
 

http://dive4elements.wald.intevation.org