Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle.sql @ 5300:a82b621d87b0
merge
author | Bettina Gruenbauer <bettina@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 14:36:32 +0100 |
parents | eaa630838705 |
children | 6dd354e7abfc |
comparison
equal
deleted
inserted
replaced
5299:bede56860646 | 5300:a82b621d87b0 |
---|---|
244 a NUMBER(38,10) NOT NULL, | 244 a NUMBER(38,10) NOT NULL, |
245 b NUMBER(38,10), | 245 b NUMBER(38,10), |
246 river_id NUMBER(38,0), | 246 river_id NUMBER(38,0), |
247 PRIMARY KEY (id) | 247 PRIMARY KEY (id) |
248 ); | 248 ); |
249 CREATE OR REPLACE TRIGGER ranges_trigger BEFORE INSERT ON ranges FOR EACH ROW | |
250 BEGIN | |
251 SELECT RANGES_ID_SEQ.nextval INTO :new.id FROM dual; | |
252 END; | |
253 / | |
249 | 254 |
250 | 255 |
251 -- RIVERS | 256 -- RIVERS |
252 CREATE SEQUENCE RIVERS_ID_SEQ; | 257 CREATE SEQUENCE RIVERS_ID_SEQ; |
253 | 258 |
269 start_time TIMESTAMP NOT NULL, | 274 start_time TIMESTAMP NOT NULL, |
270 stop_time TIMESTAMP, | 275 stop_time TIMESTAMP, |
271 PRIMARY KEY (id), | 276 PRIMARY KEY (id), |
272 CHECK (start_time <= stop_time) | 277 CHECK (start_time <= stop_time) |
273 ); | 278 ); |
279 CREATE OR REPLACE TRIGGER time_intervals_trigger BEFORE INSERT ON time_intervals FOR EACH ROW | |
280 BEGIN | |
281 SELECT TIME_INTERVALS_ID_SEQ.nextval INTO :new.id FROM dual; | |
282 END; | |
283 / | |
274 | 284 |
275 | 285 |
276 --- UNITS | 286 --- UNITS |
277 CREATE SEQUENCE UNITS_ID_SEQ; | 287 CREATE SEQUENCE UNITS_ID_SEQ; |
278 | 288 |