fix bug with keeping linking on updates

When moving the finding of linked places to the precomputation stage,
it was also moved before the statement where the linked_place_id was
removed from the linkee. The result was that the current linkee was
excluded when looking for a linked place on updates because it was
still linked to the boundary to be updated.

Fixed by allowing to either keep the linkage or change to an unlinked
place.
This commit is contained in:
Sarah Hoffmann
2022-05-23 10:11:28 +02:00
parent 4654701c10
commit 1d203fdb3c
2 changed files with 28 additions and 6 deletions

View File

@@ -2,6 +2,25 @@
Feature: Updates of linked places
Tests that linked places are correctly added and deleted.
Scenario: Linking is kept when boundary is updated
Given the places
| osm | class | type | name | geometry |
| N1 | place | city | foo | 0 0 |
And the places
| osm | class | type | name | admin | geometry |
| R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
When importing
Then placex contains
| object | linked_place_id |
| N1 | R1 |
When updating places
| osm | class | type | name | name+name:de | admin | geometry |
| R1 | boundary | administrative | foo | Dingens | 8 | poly-area:0.1 |
Then placex contains
| object | linked_place_id |
| N1 | R1 |
Scenario: Add linked place when linking relation is renamed
Given the places
| osm | class | type | name | geometry |