Mercurial > lada > lada-server
comparison db_schema/lada_schema.sql @ 1003:552215760ba8 schema-update
Moved messung.status FK constraint.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 01 Jul 2016 19:47:21 +0200 |
parents | 8ec5ee1c2dc6 |
children | c0ff3965c266 |
comparison
equal
deleted
inserted
replaced
1002:8ec5ee1c2dc6 | 1003:552215760ba8 |
---|---|
337 nebenproben_nr character varying(10), | 337 nebenproben_nr character varying(10), |
338 mmt_id character varying(2) NOT NULL REFERENCES stammdaten.mess_methode ON DELETE CASCADE, | 338 mmt_id character varying(2) NOT NULL REFERENCES stammdaten.mess_methode ON DELETE CASCADE, |
339 messdauer integer, | 339 messdauer integer, |
340 messzeitpunkt timestamp with time zone, | 340 messzeitpunkt timestamp with time zone, |
341 fertig boolean DEFAULT false NOT NULL, | 341 fertig boolean DEFAULT false NOT NULL, |
342 status integer REFERENCES status_protokoll, | 342 status integer, |
343 letzte_aenderung timestamp without time zone DEFAULT now(), | 343 letzte_aenderung timestamp without time zone DEFAULT now(), |
344 geplant boolean DEFAULT false NOT NULL, | 344 geplant boolean DEFAULT false NOT NULL, |
345 tree_modified timestamp without time zone DEFAULT now() | 345 tree_modified timestamp without time zone DEFAULT now() |
346 ); | 346 ); |
347 CREATE TRIGGER letzte_aenderung_messung BEFORE UPDATE ON messung FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); | 347 CREATE TRIGGER letzte_aenderung_messung BEFORE UPDATE ON messung FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); |
397 status_wert integer NOT NULL REFERENCES stammdaten.status_wert, | 397 status_wert integer NOT NULL REFERENCES stammdaten.status_wert, |
398 tree_modified timestamp without time zone DEFAULT now() | 398 tree_modified timestamp without time zone DEFAULT now() |
399 ); | 399 ); |
400 CREATE TRIGGER tree_modified_status_protokoll BEFORE UPDATE ON status_protokoll FOR EACH ROW EXECUTE PROCEDURE update_tree_modified(); | 400 CREATE TRIGGER tree_modified_status_protokoll BEFORE UPDATE ON status_protokoll FOR EACH ROW EXECUTE PROCEDURE update_tree_modified(); |
401 | 401 |
402 ALTER TABLE ONLY messung | |
403 ADD CONSTRAINT messung_status_protokoll_id_fkey FOREIGN KEY (status) REFERENCES status_protokoll(id); | |
404 | |
402 | 405 |
403 -- | 406 -- |
404 -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace: | 407 -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace: |
405 -- | 408 -- |
406 | 409 |