Mercurial > gemma
diff schema/geoserver_views.sql @ 3277:232fc90e6ee2
Disentangle gauge measurements and predictions
Representing both in one table has led to the necessity to make the
distinction at many places such as statements, definitions of partial
indexes and application code. At least in one place in the AGM
import the distinction in application code was too late and
measurements matching an approved measurement could have been missed.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 15 May 2019 19:08:49 +0200 |
parents | 293bdd05ffcd |
children | 831193935739 |
line wrap: on
line diff
--- a/schema/geoserver_views.sql Wed May 15 17:55:38 2019 +0200 +++ b/schema/geoserver_views.sql Wed May 15 19:08:49 2019 +0200 @@ -46,7 +46,7 @@ waterlevel_latest AS ( SELECT DISTINCT ON (fk_gauge_id) fk_gauge_id, water_level FROM waterway.gauge_measurements - WHERE is_waterlevel AND NOT predicted + WHERE is_waterlevel ORDER BY fk_gauge_id, measure_date DESC) SELECT b.id,