diff db_schema/stammdaten_schema.sql @ 1020:3779455b621c schema-update

add stammdaten.kta and stammdaten.ortszusatz add table definion and testdata change constraitns of stammdaten.ort add column hoehe_ueber_nn to stammdaten.ort
author Michael Stanko <mstanko@bfs.de>
date Thu, 07 Jul 2016 11:46:14 +0200
parents 178ac8ee17c0
children 330dec7ee0bb
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Mon Jul 04 12:10:44 2016 +0200
+++ b/db_schema/stammdaten_schema.sql	Thu Jul 07 11:46:14 2016 +0200
@@ -370,6 +370,21 @@
     ort_typ character varying(60)
 );
 
+CREATE TABLE kta (
+  id serial NOT NULL,
+  code character varying(7),
+  bezeichnung character varying(80),
+  CONSTRAINT kta_pkey PRIMARY KEY (id)
+);
+COMMENT ON TABLE kta
+  IS 'kernteschnische Anlagen';
+
+CREATE TABLE ortszusatz (
+  id serial NOT NULL,
+  code character varying(7),
+  bezeichnung character varying(80),
+  CONSTRAINT ortszusatz_pkey PRIMARY KEY (id)
+);
 
 CREATE TABLE ort (
     id serial PRIMARY KEY,
@@ -399,12 +414,14 @@
     aktiv character(1),
     anlage_id integer,
     oz_id integer,
+    hoehe_ueber_nn real,
     UNIQUE(ort_id, netzbetreiber_id)
 );
+
 CREATE TRIGGER letzte_aenderung_ort BEFORE UPDATE ON ort FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
 
 ALTER TABLE ONLY ort
-    ADD CONSTRAINT ort_anlage_fkey FOREIGN KEY (anlage_id) REFERENCES ort(id);
+    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);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)