comparison 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
comparison
equal deleted inserted replaced
5893:c1abd48a03e2 5894:62e6598a2c4b
119 id NUMBER(38,0) NOT NULL, 119 id NUMBER(38,0) NOT NULL,
120 aeo NUMBER(38,2) NOT NULL, 120 aeo NUMBER(38,2) NOT NULL,
121 datum NUMBER(38,2) NOT NULL, 121 datum NUMBER(38,2) NOT NULL,
122 name VARCHAR2(255) NOT NULL, 122 name VARCHAR2(255) NOT NULL,
123 station NUMBER(38,2) NOT NULL, 123 station NUMBER(38,2) NOT NULL,
124 official_number NUMBER(38,0) UNIQUE, 124 official_number NUMBER(38,0),
125 range_id NUMBER(38,0) NOT NULL, 125 range_id NUMBER(38,0) NOT NULL,
126 -- remove river id here because range_id references river already 126 -- TODO: remove river id here because range_id references river already
127 river_id NUMBER(38,0) NOT NULL, 127 river_id NUMBER(38,0) NOT NULL,
128 PRIMARY KEY (id), 128 PRIMARY KEY (id),
129 UNIQUE (name, river_id), 129 UNIQUE (name, river_id),
130 UNIQUE (official_number, river_id),
130 UNIQUE (river_id, station) 131 UNIQUE (river_id, station)
131 ); 132 );
132 133
133 134
134 -- HYK_ENTRIES 135 -- HYK_ENTRIES

http://dive4elements.wald.intevation.org