Mercurial > dive4elements > river
changeset 5300:a82b621d87b0
merge
author | Bettina Gruenbauer <bettina@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 14:36:32 +0100 (2013-03-14) |
parents | bede56860646 (current diff) eaa630838705 (diff) |
children | 7d29c277000e |
files | |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle.sql Thu Mar 14 14:35:51 2013 +0100 +++ b/flys-backend/doc/schema/oracle.sql Thu Mar 14 14:36:32 2013 +0100 @@ -246,6 +246,11 @@ river_id NUMBER(38,0), PRIMARY KEY (id) ); +CREATE OR REPLACE TRIGGER ranges_trigger BEFORE INSERT ON ranges FOR EACH ROW + BEGIN + SELECT RANGES_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/ -- RIVERS @@ -271,6 +276,11 @@ PRIMARY KEY (id), CHECK (start_time <= stop_time) ); +CREATE OR REPLACE TRIGGER time_intervals_trigger BEFORE INSERT ON time_intervals FOR EACH ROW + BEGIN + SELECT TIME_INTERVALS_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/ --- UNITS
--- a/flys-backend/doc/schema/postgresql.sql Thu Mar 14 14:35:51 2013 +0100 +++ b/flys-backend/doc/schema/postgresql.sql Thu Mar 14 14:36:32 2013 +0100 @@ -36,6 +36,8 @@ b NUMERIC, UNIQUE (river_id, a, b) ); +ALTER TABLE ranges ALTER COLUMN id SET DEFAULT NEXTVAL('RANGES_ID_SEQ'); + -- Lage 'links', 'rechts', etc. CREATE SEQUENCE POSITIONS_ID_SEQ; @@ -123,6 +125,8 @@ stop_time TIMESTAMP, CHECK (start_time <= stop_time) ); +ALTER TABLE time_intervals ALTER COLUMN id SET DEFAULT NEXTVAL('TIME_INTERVALS_ID_SEQ'); + -- Stammdaten CREATE SEQUENCE MAIN_VALUES_ID_SEQ;