Mercurial > gemma
view schema/updates/1439/01.add_bn_id_to_bn_overview.sql @ 5677:a57be8bfb6ea sr-v2
More suited file names.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 11 Feb 2024 09:51:21 +0100 |
parents | 0b051ee3f238 |
children |
line wrap: on
line source
-- Add bottleneck_id column to bottleneck_overview view. UPDATE sys_admin.published_services SET view_def = $$ SELECT objnam AS name, bn.bottleneck_id, ST_Centroid(area) AS point, (lower(stretch)).hectometre AS from, (upper(stretch)).hectometre AS to, sr.current::text, responsible_country FROM waterway.bottlenecks bn LEFT JOIN ( SELECT bottleneck_id, max(date_info) AS current FROM waterway.sounding_results GROUP BY bottleneck_id) sr ON sr.bottleneck_id = bn.bottleneck_id WHERE bn.validity @> current_timestamp ORDER BY objnam $$ WHERE schema = 'waterway' AND name = 'bottleneck_overview';