1
1
Fork
You've already forked api
0

Remove unique index place_osm #35

Merged
boramalper merged 1 commit from bora/rm-unique-index-place_osm into main 2026年06月05日 23:53:59 +02:00

What

The unique index place_osm that we have defined on socialmaps.place (osm_type, osm_id) was causing issues when an existing place was renamed.

Why

For example, Node #349283463 was renamed from "Coffee Dock" to "Insomnia" in changeset #182673214. This meant that there were no matching socialmaps.place for the updated osm2pgsql.element with the new name (since we're matching places to elements using name + location). When socialmaps-api tried to create a new place for the given element returned in the resultset, it got a database error for trying to violate the uniqueness constraint of the index.

Notes

We need to invest into handling changes to elements in the context of "place permanence". For instance, should the aforementioned rename ("Coffee Dock" → "Insomnia") result in a new place (I think so) or should we treat it as the same cafe and move its existing reviews over? There are no reviews of it at the moment, but we'll have to have a policy around such changes for future.

## What The unique index `place_osm` that we have defined on `socialmaps.place (osm_type, osm_id)` was causing issues when an existing place was renamed. ## Why For example, [Node #349283463](https://www.openstreetmap.org/node/349283463) was renamed from "Coffee Dock" to "Insomnia" in [changeset #182673214](https://www.openstreetmap.org/changeset/182673214). This meant that there were no matching `socialmaps.place` for the updated `osm2pgsql.element` with the new name (since we're matching places to elements using name + location). When `socialmaps-api` tried to create a new `place` for the given `element` returned in the resultset, it got a database error for trying to violate the uniqueness constraint of the index. ## Notes We need to invest into handling changes to elements in the context of "place permanence". For instance, should the aforementioned rename ("Coffee Dock" → "Insomnia") result in a new place (I think so) or should we treat it as the same cafe and move its existing reviews over? There are no reviews of it at the moment, but we'll have to have a policy around such changes for future.
Remove unique index place_osm
All checks were successful
ci/woodpecker/pr/main Pipeline was successful
d6b66aa007
boramalper deleted branch bora/rm-unique-index-place_osm 2026年06月05日 23:53:59 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
socialmaps/api!35
Reference in a new issue
socialmaps/api
No description provided.
Delete branch "bora/rm-unique-index-place_osm"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?