changeset 1001:1c4aa7ea63aa schema-update

Moved trigger creation to table definition.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 01 Jul 2016 19:04:49 +0200
parents 1489f0ade850
children 8ec5ee1c2dc6
files db_schema/lada_schema.sql
diffstat 1 files changed, 6 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/db_schema/lada_schema.sql	Fri Jul 01 19:01:32 2016 +0200
+++ b/db_schema/lada_schema.sql	Fri Jul 01 19:04:49 2016 +0200
@@ -252,6 +252,7 @@
     UNIQUE (mst_id, hauptproben_nr)
 );
 CREATE TRIGGER letzte_aenderung_probe BEFORE UPDATE ON probe FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
+CREATE TRIGGER tree_timestamp_probe BEFORE UPDATE ON probe FOR EACH ROW EXECUTE PROCEDURE update_time_probe();
 
 
 --
@@ -281,6 +282,7 @@
     tree_modified timestamp without time zone DEFAULT now()
 );
 CREATE TRIGGER letzte_aenderung_ortszuordnung BEFORE UPDATE ON ortszuordnung FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
+CREATE TRIGGER tree_timestamp_ort BEFORE UPDATE ON ortszuordnung FOR EACH ROW EXECUTE PROCEDURE update_time_ort();
 
 
 --
@@ -299,6 +301,7 @@
     UNIQUE (probe_id, pzs_id)
 );
 CREATE TRIGGER letzte_aenderung_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
+CREATE TRIGGER tree_timestamp_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_time_zusatzwert();
 
 
 --
@@ -396,6 +399,7 @@
     geplant boolean DEFAULT false NOT NULL,
     tree_modified timestamp without time zone DEFAULT now()
 );
+CREATE TRIGGER tree_timestamp_messung BEFORE UPDATE ON messung FOR EACH ROW EXECUTE PROCEDURE update_time_messung();
 
 
 --
@@ -430,6 +434,7 @@
     UNIQUE (messungs_id, messgroesse_id)
 );
 CREATE TRIGGER letzte_aenderung_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
+CREATE TRIGGER tree_timestamp_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_time_messwert();
 
 
 --
@@ -446,6 +451,7 @@
     status_wert integer NOT NULL REFERENCES stammdaten.status_wert,
     tree_modified timestamp without time zone DEFAULT now()
 );
+CREATE TRIGGER tree_timestamp_status BEFORE UPDATE ON status_protokoll FOR EACH ROW EXECUTE PROCEDURE update_time_status();
 
 
 --
@@ -469,46 +475,4 @@
 CREATE INDEX probe_id_idx ON probe USING btree (id);
 
 
---
--- Name: tree_timestamp_status; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_status BEFORE UPDATE ON status_protokoll FOR EACH ROW EXECUTE PROCEDURE update_time_status();
-
-
---
--- Name: tree_timestamp_messung; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_messung BEFORE UPDATE ON messung FOR EACH ROW EXECUTE PROCEDURE update_time_messung();
-
-
---
--- Name: tree_timestamp_messwert; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_time_messwert();
-
-
---
--- Name: tree_timestamp_ort; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_ort BEFORE UPDATE ON ortszuordnung FOR EACH ROW EXECUTE PROCEDURE update_time_ort();
-
-
---
--- Name: tree_timestamp_probe; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_probe BEFORE UPDATE ON probe FOR EACH ROW EXECUTE PROCEDURE update_time_probe();
-
-
---
--- Name: tree_timestamp_zusatzwert; Type: TRIGGER; Schema: land; Owner: -
---
-
-CREATE TRIGGER tree_timestamp_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_time_zusatzwert();
-
-
 COMMIT;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)