comparison schema/gemma.sql @ 2172:7e2c77ccc02f

Removed trigger to update date_info on gauge_measurements. The date info can be explicitly set by imported data, e.g. in approved gauge measurements. Overwriting this provided data seems wrong...
author Sascha Wilde <wilde@intevation.de>
date Fri, 08 Feb 2019 17:55:42 +0100
parents 3bfe48e32f20
children 4374d942b23d
comparison
equal deleted inserted replaced
2171:543b5d071a69 2172:7e2c77ccc02f
2 -- without warranty, see README.md and license for details. 2 -- without warranty, see README.md and license for details.
3 3
4 -- SPDX-License-Identifier: AGPL-3.0-or-later 4 -- SPDX-License-Identifier: AGPL-3.0-or-later
5 -- License-Filename: LICENSES/AGPL-3.0.txt 5 -- License-Filename: LICENSES/AGPL-3.0.txt
6 6
7 -- Copyright (C) 2018 by via donau 7 -- Copyright (C) 2018,2019 by via donau
8 -- – Österreichische Wasserstraßen-Gesellschaft mbH 8 -- – Österreichische Wasserstraßen-Gesellschaft mbH
9 -- Software engineering by Intevation GmbH 9 -- Software engineering by Intevation GmbH
10 10
11 -- Author(s): 11 -- Author(s):
12 -- * Tom Gottfried <tom@intevation.de> 12 -- * Tom Gottfried <tom@intevation.de>
13 -- * Sascha Teichmann <sascha.teichmann@intevation.de> 13 -- * Sascha Teichmann <sascha.teichmann@intevation.de>
14 -- * Sascha Wilde <sascha.wilde@intevation.de>
14 15
15 BEGIN; 16 BEGIN;
16 17
17 -- 18 --
18 -- Infrastructure 19 -- Infrastructure
290 staging_done boolean NOT NULL DEFAULT false, 291 staging_done boolean NOT NULL DEFAULT false,
291 -- So we can have a staged and 292 -- So we can have a staged and
292 -- a non-staged fk_gauge_id/measure_date pair. 293 -- a non-staged fk_gauge_id/measure_date pair.
293 UNIQUE (fk_gauge_id, measure_date, staging_done) 294 UNIQUE (fk_gauge_id, measure_date, staging_done)
294 ) 295 )
295 CREATE TRIGGER gauge_measurements_date_info
296 BEFORE UPDATE ON gauge_measurements
297 FOR EACH ROW EXECUTE PROCEDURE update_date_info()
298 296
299 CREATE TABLE waterway_axis ( 297 CREATE TABLE waterway_axis (
300 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 298 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
301 wtwaxs geography(LINESTRING, 4326) NOT NULL 299 wtwaxs geography(LINESTRING, 4326) NOT NULL
302 CHECK(ST_IsSimple(CAST(wtwaxs AS geometry))), 300 CHECK(ST_IsSimple(CAST(wtwaxs AS geometry))),