From 53466bb817e02e2611b71add27a90029c9f2dbde Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Tue, 28 Aug 2012 18:41:02 +0100 Subject: [PATCH] linked places not being updated on road modification --- sql/functions.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/functions.sql b/sql/functions.sql index b1280cac..13c682ae 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1271,6 +1271,7 @@ BEGIN DELETE FROM place_boundingbox where place_id = NEW.place_id; result := deleteRoad(NEW.partition, NEW.place_id); result := deleteLocationArea(NEW.partition, NEW.place_id); + UPDATE placex set linked_place_id = null, indexed_status = 2 where linked_place_id = NEW.place_id and indexed_status = 0; UPDATE placex set linked_place_id = null where linked_place_id = NEW.place_id; END IF; @@ -1765,9 +1766,9 @@ DECLARE BEGIN -- RAISE WARNING 'placex_delete % %',OLD.osm_type,OLD.osm_id; - update placex set linked_place_id = null where linked_place_id = OLD.place_id; + update placex set linked_place_id = null, indexed_status = 2 where linked_place_id = OLD.place_id and indexed_status = 0; --DEBUG: RAISE WARNING 'placex_delete:01 % %',OLD.osm_type,OLD.osm_id; - update placex set indexed_status = 2 where linked_place_id = OLD.place_id and indexed_status = 0; + update placex set linked_place_id = null where linked_place_id = OLD.place_id; --DEBUG: RAISE WARNING 'placex_delete:02 % %',OLD.osm_type,OLD.osm_id; IF OLD.rank_address < 30 THEN -- 2.45.2