Mercurial > lada > lada-server
diff db_schema/stammdaten_schema.sql @ 1030:330dec7ee0bb schema-update
merged.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 08 Jul 2016 15:35:24 +0200 |
parents | b29098d201c2 3779455b621c |
children | 1c6c83037b8c |
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql Fri Jul 08 15:34:33 2016 +0200 +++ b/db_schema/stammdaten_schema.sql Fri Jul 08 15:35:24 2016 +0200 @@ -403,6 +403,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, @@ -432,12 +447,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);