[Lada-commits] [PATCH 11 of 12] Added inline FK constraints

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


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1467626726 -7200
# Branch schema-update
# Node ID 8912b6f1776d5111f3a23fefafbfd264c9647337
# Parent  9f903c54141b34c31e475acf1988ae93a83fcb2a
Added inline FK constraints.

diff -r 9f903c54141b -r 8912b6f1776d db_schema/stammdaten_schema.sql
--- a/db_schema/stammdaten_schema.sql	Mon Jul 04 12:04:50 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Mon Jul 04 12:05:26 2016 +0200
@@ -118,14 +118,14 @@
     eu character(1) DEFAULT NULL::bpchar,
     koord_x_extern character varying(22),
     koord_y_extern character varying(22),
-    kda_id integer
+    kda_id integer REFERENCES koordinaten_art
 );
 
 
 CREATE TABLE verwaltungseinheit (
     id character varying(8) PRIMARY KEY,
     bundesland character varying(8) NOT NULL,
-    kda_id integer,
+    kda_id integer REFERENCES koordinaten_art,
     kreis character varying(8),
     nuts character varying(10),
     regbezirk character varying(8),
@@ -185,8 +185,8 @@
 
 CREATE TABLE auth_lst_umw (
     id serial PRIMARY KEY,
-    mst_id character varying(5),
-    umw_id character varying(3)
+    mst_id character varying(5) REFERENCES mess_stelle,
+    umw_id character varying(3) REFERENCES umwelt
 );
 
 
@@ -245,13 +245,13 @@
     s10 integer,
     s11 integer,
     s12 integer,
-    umw_id character varying(3) NOT NULL
+    umw_id character varying(3) NOT NULL REFERENCES umwelt
 );
 
 
 CREATE TABLE deskriptoren (
     id serial PRIMARY KEY,
-    vorgaenger integer,
+    vorgaenger integer REFERENCES deskriptoren,
     ebene smallint,
     s_xx integer,
     sn smallint,
@@ -338,14 +338,14 @@
 
 
 CREATE TABLE mg_grp (
-    messgroessengruppe_id integer NOT NULL,
-    messgroesse_id integer NOT NULL
+    messgroessengruppe_id integer NOT NULL REFERENCES messgroessen_gruppe,
+    messgroesse_id integer NOT NULL REFERENCES messgroesse
 );
 
 
 CREATE TABLE mmt_messgroesse_grp (
-    messgroessengruppe_id integer NOT NULL,
-    mmt_id character varying(2) NOT NULL
+    messgroessengruppe_id integer NOT NULL REFERENCES messgroessen_gruppe,
+    mmt_id character varying(2) NOT NULL REFERENCES mess_methode
 );
 
 
@@ -411,15 +411,15 @@
 CREATE TABLE pflicht_messgroesse (
     id serial PRIMARY KEY,
     messgroesse_id integer,
-    mmt_id character varying(2),
-    umw_id character varying(3),
-    datenbasis_id smallint NOT NULL
+    mmt_id character varying(2) REFERENCES mess_methode,
+    umw_id character varying(3) REFERENCES umwelt,
+    datenbasis_id smallint NOT NULL REFERENCES datenbasis
 );
 
 
 CREATE TABLE proben_zusatz (
     id character varying(3) PRIMARY KEY,
-    meh_id integer,
+    meh_id integer REFERENCES mess_einheit,
     beschreibung character varying(50) NOT NULL,
     zusatzwert character varying(7) NOT NULL,
     eudf_keyword character varying(40)


More information about the Lada-commits mailing list