Mercurial > lada > lada-server
changeset 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 |
files | db_schema/lada_schema.sql |
diffstat | 1 files changed, 4 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/db_schema/lada_schema.sql Fri Jul 01 18:07:33 2016 +0200 +++ b/db_schema/lada_schema.sql Fri Jul 01 18:11:48 2016 +0200 @@ -278,7 +278,8 @@ meh_id smallint NOT NULL, grenzwertueberschreitung boolean DEFAULT false, letzte_aenderung timestamp without time zone DEFAULT now(), - tree_modified timestamp without time zone DEFAULT now() + tree_modified timestamp without time zone DEFAULT now(), + UNIQUE (messungs_id, messgroesse_id) ); CREATE TRIGGER letzte_aenderung_messwert BEFORE UPDATE ON messwert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); @@ -439,28 +440,13 @@ messfehler real, letzte_aenderung timestamp without time zone DEFAULT now(), nwg_zu_messwert double precision, - tree_modified timestamp without time zone DEFAULT now() + tree_modified timestamp without time zone DEFAULT now(), + UNIQUE (probe_id, pzs_id) ); CREATE TRIGGER letzte_aenderung_zusatzwert BEFORE UPDATE ON zusatz_wert FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); -- --- Name: messwert_messungs_id_messgroesse_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace: --- - -ALTER TABLE ONLY messwert - ADD CONSTRAINT messwert_messungs_id_messgroesse_id_key UNIQUE (messungs_id, messgroesse_id); - - --- --- Name: zusatz_wert_probe_id_pzs_id_key; Type: CONSTRAINT; Schema: land; Owner: -; Tablespace: --- - -ALTER TABLE ONLY zusatz_wert - ADD CONSTRAINT zusatz_wert_probe_id_pzs_id_key UNIQUE (probe_id, pzs_id); - - --- -- Name: messung_probe_id_idx; Type: INDEX; Schema: land; Owner: -; Tablespace: --