diff db_schema/stammdaten_schema.sql @ 905:df2908334150

Set netzbetreiber-specific IDs UNIQUE per netzbetreiber.
author Tom Gottfried <tom@intevation.de>
date Tue, 05 Apr 2016 10:49:13 +0200
parents 825d82b8ad6e
children d8c66007fa14
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Tue Apr 05 10:29:55 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Tue Apr 05 10:49:13 2016 +0200
@@ -216,7 +216,8 @@
     da_erzeuger_id character varying(2) NOT NULL,
     mst_id character varying(5) NOT NULL REFERENCES mess_stelle,
     bezeichnung character varying(120) NOT NULL,
-    letzte_aenderung timestamp without time zone
+    letzte_aenderung timestamp without time zone,
+    UNIQUE(da_erzeuger_id, netzbetreiber_id)
 );
 
 ALTER SEQUENCE datensatz_erzeuger_id_seq OWNED BY datensatz_erzeuger.id;
@@ -450,7 +451,8 @@
     netzbetreiber_id character varying(2) NOT NULL REFERENCES netz_betreiber,
     mpl_id character varying(3) NOT NULL,
     bezeichnung character varying(120) NOT NULL,
-    letzte_aenderung timestamp without time zone
+    letzte_aenderung timestamp without time zone,
+    UNIQUE(mpl_id, netzbetreiber_id)
 );
 
 ALTER SEQUENCE messprogramm_kategorie_id_seq
@@ -517,7 +519,8 @@
     mp_art character varying(10),
     aktiv character(1),
     anlage_id integer,
-    oz_id integer
+    oz_id integer,
+    UNIQUE(ort_id, netzbetreiber_id)
 );
 
 ALTER TABLE ONLY ort
@@ -602,7 +605,8 @@
     telefon character varying(20),
     tp character varying(3),
     typ character(1),
-    letzte_aenderung timestamp without time zone
+    letzte_aenderung timestamp without time zone,
+    UNIQUE(prn_id, netzbetreiber_id)
 );
 
 ALTER SEQUENCE probenehmer_id_seq OWNED BY probenehmer.id;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)