diff db_schema/stammdaten_schema.sql @ 1143:b49c1fb84040

Updated stammdaten schema.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 07 Nov 2016 10:04:57 +0100
parents d1d7d684800c
children 60b91dbb98cc
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Thu Nov 03 14:41:13 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Mon Nov 07 10:04:57 2016 +0100
@@ -413,10 +413,8 @@
   IS 'kernteschnische Anlagen';
 
 CREATE TABLE ortszusatz (
-  id serial NOT NULL,
-  code character varying(7),
-  bezeichnung character varying(80),
-  CONSTRAINT ortszusatz_pkey PRIMARY KEY (id)
+    ozs_id character varying(7) PRIMARY KEY,
+    ortszusatz character varying(80) NOT NULL
 );
 
 CREATE TABLE ort (
@@ -446,7 +444,7 @@
     mp_art character varying(10),
     aktiv character(1),
     anlage_id integer,
-    oz_id integer,
+    oz_id character varying(7) REFERENCES ortszusatz(ozs_id),
     hoehe_ueber_nn real,
     UNIQUE(ort_id, netzbetreiber_id)
 );
@@ -456,9 +454,6 @@
 ALTER TABLE ONLY ort
     ADD CONSTRAINT ort_kta_fkey FOREIGN KEY (anlage_id) REFERENCES kta(id);
 
-ALTER TABLE ONLY ort
-    ADD CONSTRAINT ort_oz_fkey FOREIGN KEY (oz_id) REFERENCES ort(id);
-
 
 CREATE TABLE ortszuordnung_typ (
     id character(1) PRIMARY KEY,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)