When linked the place may not be in the search index,
so it must be reindexed when being unlinked. The status
change will only have an effect during the subsequent
update, so change tests to that effect.
DELETE FROM place_addressline WHERE place_id = NEW.place_id;
result := deleteRoad(NEW.partition, NEW.place_id);
result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search);
DELETE FROM place_addressline WHERE place_id = NEW.place_id;
result := deleteRoad(NEW.partition, NEW.place_id);
result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search);
- UPDATE placex set linked_place_id = null where linked_place_id = NEW.place_id;
+ UPDATE placex set linked_place_id = null, indexed_status = 2
+ where linked_place_id = NEW.place_id;
IF NEW.linked_place_id is not null THEN
RETURN NEW;
IF NEW.linked_place_id is not null THEN
RETURN NEW;
Then table placex contains
| object | linked_place_id
| N1 | None
Then table placex contains
| object | linked_place_id
| N1 | None
+ When updating place areas
+ | osm_type | osm_id | class | type | name | admin_level | geometry
When sending query "foo" with dups
Then results contain
| osm_type
When sending query "foo" with dups
Then results contain
| osm_type
Then table placex contains
| object | linked_place_id
| N1 | None
Then table placex contains
| object | linked_place_id
| N1 | None
+ When updating place areas
+ | osm_type | osm_id | class | type | name | admin_level | geometry
And sending query "foo" with dups
Then results contain
| osm_type
And sending query "foo" with dups
Then results contain
| osm_type