[Dive4elements-commits] [PATCH 2 of 2] merge

Wald Commits scm-commit at wald.intevation.org
Thu Mar 14 14:36:43 CET 2013


# HG changeset patch
# User Bettina Gruenbauer <bettina at intevation.de>
# Date 1363268192 -3600
# Node ID a82b621d87b03c83a84cc3a090a8a4dfdd85ab6e
# Parent  bede568606460ee6c9e2f40d8503453952143390
# Parent  eaa63083870544438e3b2783c1f9236d4053d506
merge

diff -r bede56860646 -r a82b621d87b0 flys-backend/doc/schema/oracle.sql
--- 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
diff -r bede56860646 -r a82b621d87b0 flys-backend/doc/schema/postgresql.sql
--- 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;


More information about the Dive4elements-commits mailing list