From ca75e8004f9d5e0909efd8a080e5ae442e3bdb02 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 14 Apr 2022 13:37:15 +0100 Subject: [PATCH] fix mark ddemolitions script psql --- etl/mark_demolitions.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/etl/mark_demolitions.sh b/etl/mark_demolitions.sh index 74ebe28d..523963dd 100644 --- a/etl/mark_demolitions.sh +++ b/etl/mark_demolitions.sh @@ -18,8 +18,6 @@ psql -c "INSERT INTO old_geometries ( source_id, geometry_geom ) echo "Set each building's latest_demolish_date for today if linked geometry in the db not present in new data..." psql -c "UPDATE buildings AS b - SET latest_demolish_date = CURRENT_DATE - WHERE b.source_id = g.source_id - AND source_id IN (SELECT source_id - FROM old_geometries AS g - );" \ No newline at end of file + SET b.latest_demolish_date = CURRENT_DATE + FROM old_geometries AS og + WHERE b.ref_toid = og.source_id;" \ No newline at end of file