[Lada-commits] [PATCH 12 of 12] Made most constraints inline

Wald Commits scm-commit at wald.intevation.org
Mon Jul 4 12:09:18 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1467626941 -7200
# Branch schema-update
# Node ID dd86066d75155b829189a9c4c4dd86fd85c25c59
# Parent  8912b6f1776d5111f3a23fefafbfd264c9647337
Made most constraints inline.

diff -r 8912b6f1776d -r dd86066d7515 db_schema/stammdaten_schema.sql
--- a/db_schema/stammdaten_schema.sql	Mon Jul 04 12:05:26 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Mon Jul 04 12:09:01 2016 +0200
@@ -106,6 +106,7 @@
     beschreibung character varying(300),
     umwelt_bereich character varying(80) NOT NULL,
     meh_id integer REFERENCES mess_einheit
+    UNIQUE (umwelt_bereich);
 );
 
 
@@ -263,6 +264,7 @@
 CREATE TABLE lada_user (
     id serial PRIMARY KEY,
     name character varying(80) NOT NULL
+    UNIQUE (name);
 );
 
 
@@ -341,12 +343,18 @@
     messgroessengruppe_id integer NOT NULL REFERENCES messgroessen_gruppe,
     messgroesse_id integer NOT NULL REFERENCES messgroesse
 );
+ALTER TABLE ONLY mg_grp
+    ADD CONSTRAINT mg_grp_pkey PRIMARY KEY (messgroessengruppe_id, messgroesse_id);
 
 
 CREATE TABLE mmt_messgroesse_grp (
     messgroessengruppe_id integer NOT NULL REFERENCES messgroessen_gruppe,
     mmt_id character varying(2) NOT NULL REFERENCES mess_methode
 );
+ALTER TABLE ONLY mmt_messgroesse_grp
+    ADD CONSTRAINT mmt_messgroesse_grp_pkey PRIMARY KEY (messgroessengruppe_id, mmt_id);
+
+
 
 
 CREATE VIEW mmt_messgroesse AS
@@ -423,6 +431,7 @@
     beschreibung character varying(50) NOT NULL,
     zusatzwert character varying(7) NOT NULL,
     eudf_keyword character varying(40)
+    UNIQUE (eudf_keyword);
 );
 
 
@@ -581,26 +590,6 @@
 -- Status workflow
 
 
-ALTER TABLE ONLY lada_user
-    ADD CONSTRAINT lada_user_name_key UNIQUE (name);
-
-
-ALTER TABLE ONLY mg_grp
-    ADD CONSTRAINT mg_grp_pkey PRIMARY KEY (messgroessengruppe_id, messgroesse_id);
-
-
-ALTER TABLE ONLY mmt_messgroesse_grp
-    ADD CONSTRAINT mmt_messgroesse_grp_pkey PRIMARY KEY (messgroessengruppe_id, mmt_id);
-
-
-ALTER TABLE ONLY proben_zusatz
-    ADD CONSTRAINT proben_zusatz_eudf_keyword_key UNIQUE (eudf_keyword);
-
-
-ALTER TABLE ONLY umwelt
-    ADD CONSTRAINT umwelt_umwelt_bereich_key UNIQUE (umwelt_bereich);
-
-
 CREATE INDEX de_vg_geom_gist ON de_vg USING gist (geom);
 
 


More information about the Lada-commits mailing list