[Lada-commits] [PATCH 07 of 14] Moved unique constraints into table definition

Wald Commits scm-commit at wald.intevation.org
Fri Jul 1 19:54:59 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1467389508 -7200
# Branch schema-update
# Node ID c22a99d5c6f1295ac03f75c3b4da3ab3450e3d16
# Parent  1f23867d69e9fd6c4761982c9753f9ba0c657682
Moved unique constraints into table definition.

diff -r 1f23867d69e9 -r c22a99d5c6f1 db_schema/lada_schema.sql
--- a/db_schema/lada_schema.sql	Fri Jul 01 18:07:33 2016 +0200
+++ b/db_schema/lada_schema.sql	Fri Jul 01 18:11:48 2016 +0200
@@ -278,7 +278,8 @@
     meh_id smallint NOT NULL,
     grenzwertueberschreitung boolean DEFAULT false,
     letzte_aenderung timestamp without time zone DEFAULT now(),
-    tree_modified timestamp without time zone DEFAULT now()
+    tree_modified timestamp without time zone DEFAULT now(),
+    UNIQUE (messungs_id, messgroesse_id)
 );
 CREATE TRIGGER letzte_aenderung_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
 
@@ -439,28 +440,13 @@
     messfehler real,
     letzte_aenderung timestamp without time zone DEFAULT now(),
     nwg_zu_messwert double precision,
-    tree_modified timestamp without time zone DEFAULT now()
+    tree_modified timestamp without time zone DEFAULT now(),
+    UNIQUE (probe_id, pzs_id)
 );
 CREATE TRIGGER letzte_aenderung_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
 
 
 --
--- Name: messwert_messungs_id_messgroesse_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace:
---
-
-ALTER TABLE ONLY messwert
-    ADD CONSTRAINT messwert_messungs_id_messgroesse_id_key UNIQUE (messungs_id, messgroesse_id);
-
-
---
--- Name: zusatz_wert_probe_id_pzs_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace:
---
-
-ALTER TABLE ONLY zusatz_wert
-    ADD CONSTRAINT zusatz_wert_probe_id_pzs_id_key UNIQUE (probe_id, pzs_id);
-
-
---
 -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace:
 --
 


More information about the Lada-commits mailing list