comparison 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
comparison
equal deleted inserted replaced
3276:75db3199f76e 3277:232fc90e6ee2
44 FROM waterway.fairway_availability 44 FROM waterway.fairway_availability
45 ORDER BY bottleneck_id, date_info DESC), 45 ORDER BY bottleneck_id, date_info DESC),
46 waterlevel_latest AS ( 46 waterlevel_latest AS (
47 SELECT DISTINCT ON (fk_gauge_id) fk_gauge_id, water_level 47 SELECT DISTINCT ON (fk_gauge_id) fk_gauge_id, water_level
48 FROM waterway.gauge_measurements 48 FROM waterway.gauge_measurements
49 WHERE is_waterlevel AND NOT predicted 49 WHERE is_waterlevel
50 ORDER BY fk_gauge_id, measure_date DESC) 50 ORDER BY fk_gauge_id, measure_date DESC)
51 SELECT 51 SELECT
52 b.id, 52 b.id,
53 b.bottleneck_id, 53 b.bottleneck_id,
54 b.objnam, 54 b.objnam,