changeset 4028:5fed2f5bc104 historization_ng

End validity of gauge if it gets deleted during import.
author Sascha Wilde <wilde@intevation.de>
date Wed, 17 Jul 2019 17:52:04 +0200
parents 78c9aef329cd
children 9cfc6f478157
files pkg/imports/wg.go
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/wg.go	Wed Jul 17 17:17:05 2019 +0200
+++ b/pkg/imports/wg.go	Wed Jul 17 17:52:04 2019 +0200
@@ -66,7 +66,7 @@
 
 const (
 	eraseObsoleteGaugesSQL = `
-UPDATE waterway.gauges SET erased = true
+UPDATE waterway.gauges SET erased = true, validity = validity - '[now,)'
 WHERE NOT erased
   AND (location).country_code = ANY($1)
   AND isrs_astext(location) <> ALL($2)