mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 05:18:00 +00:00
reindex postcodes that loose their parents
When the parent place of a postcode is deleted, it needs to be reindexed to get a new parent. Otherwise displaying of results is broken.
This commit is contained in:
@@ -1399,6 +1399,8 @@ BEGIN
|
||||
|
||||
{% if debug %}RAISE WARNING 'placex_delete:12 % %',OLD.osm_type,OLD.osm_id;{% endif %}
|
||||
|
||||
UPDATE location_postcode SET indexed_status = 2 WHERE parent_place_id = OLD.place_id;
|
||||
|
||||
RETURN OLD;
|
||||
|
||||
END;
|
||||
|
||||
@@ -81,6 +81,9 @@ CREATE INDEX IF NOT EXISTS idx_postcode_postcode
|
||||
type TEXT,
|
||||
deferred BOOLEAN
|
||||
);
|
||||
---
|
||||
CREATE INDEX IF NOT EXISTS idx_location_postcode_parent_place_id
|
||||
ON location_postcode USING BTREE (parent_place_id) {{db.tablespace.address_index}};
|
||||
{% endif %}
|
||||
|
||||
-- Indices only needed for search.
|
||||
|
||||
Reference in New Issue
Block a user