Mercurial > lada > lada-server
comparison db_schema/lada_schema.sql @ 998:c22a99d5c6f1 schema-update
Moved unique constraints into table definition.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 01 Jul 2016 18:11:48 +0200 |
parents | 1f23867d69e9 |
children | 813461e9a7be |
comparison
equal
deleted
inserted
replaced
997:1f23867d69e9 | 998:c22a99d5c6f1 |
---|---|
276 messfehler real, | 276 messfehler real, |
277 nwg_zu_messwert double precision, | 277 nwg_zu_messwert double precision, |
278 meh_id smallint NOT NULL, | 278 meh_id smallint NOT NULL, |
279 grenzwertueberschreitung boolean DEFAULT false, | 279 grenzwertueberschreitung boolean DEFAULT false, |
280 letzte_aenderung timestamp without time zone DEFAULT now(), | 280 letzte_aenderung timestamp without time zone DEFAULT now(), |
281 tree_modified timestamp without time zone DEFAULT now() | 281 tree_modified timestamp without time zone DEFAULT now(), |
282 UNIQUE (messungs_id, messgroesse_id) | |
282 ); | 283 ); |
283 CREATE TRIGGER letzte_aenderung_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); | 284 CREATE TRIGGER letzte_aenderung_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); |
284 | 285 |
285 | 286 |
286 -- | 287 -- |
437 pzs_id character varying(3) NOT NULL, | 438 pzs_id character varying(3) NOT NULL, |
438 messwert_pzs double precision, | 439 messwert_pzs double precision, |
439 messfehler real, | 440 messfehler real, |
440 letzte_aenderung timestamp without time zone DEFAULT now(), | 441 letzte_aenderung timestamp without time zone DEFAULT now(), |
441 nwg_zu_messwert double precision, | 442 nwg_zu_messwert double precision, |
442 tree_modified timestamp without time zone DEFAULT now() | 443 tree_modified timestamp without time zone DEFAULT now(), |
444 UNIQUE (probe_id, pzs_id) | |
443 ); | 445 ); |
444 CREATE TRIGGER letzte_aenderung_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); | 446 CREATE TRIGGER letzte_aenderung_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); |
445 | |
446 | |
447 -- | |
448 -- Name: messwert_messungs_id_messgroesse_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace: | |
449 -- | |
450 | |
451 ALTER TABLE ONLY messwert | |
452 ADD CONSTRAINT messwert_messungs_id_messgroesse_id_key UNIQUE (messungs_id, messgroesse_id); | |
453 | |
454 | |
455 -- | |
456 -- Name: zusatz_wert_probe_id_pzs_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace: | |
457 -- | |
458 | |
459 ALTER TABLE ONLY zusatz_wert | |
460 ADD CONSTRAINT zusatz_wert_probe_id_pzs_id_key UNIQUE (probe_id, pzs_id); | |
461 | 447 |
462 | 448 |
463 -- | 449 -- |
464 -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace: | 450 -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace: |
465 -- | 451 -- |