Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extratags should become null when empty #3333

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib-sql/functions/placex_triggers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- This file is part of Nominatim. (https://nominatim.org)
--
-- Copyright (C) 2022 by the Nominatim developer community.
-- Copyright (C) 2024 by the Nominatim developer community.
-- For a full list of authors see the git log.

-- Trigger functions for the placex table.
Expand Down Expand Up @@ -794,6 +794,9 @@ BEGIN
result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search);

NEW.extratags := NEW.extratags - 'linked_place'::TEXT;
IF NEW.extratags = ''::hstore THEN
NEW.extratags := NULL;
END IF;

-- NEW.linked_place_id contains the precomputed linkee. Save this and restore
-- the previous link status.
Expand Down
2 changes: 1 addition & 1 deletion test/bdd/db/update/linked_places.feature
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Feature: Updates of linked places
When marking for delete N1
Then placex contains
| object | extratags |
| R1 | |
| R1 | - |

Scenario: Update linked_place info when linkee type changes
Given the 0.1 grid
Expand Down
Loading