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

split area_place into areas_by_entity and places_by_entity #1217

Open
lydavid opened this issue Nov 7, 2024 · 1 comment
Open

split area_place into areas_by_entity and places_by_entity #1217

lydavid opened this issue Nov 7, 2024 · 1 comment

Comments

@lydavid
Copy link
Owner

lydavid commented Nov 7, 2024

When refreshing a place, we call this:

-- An area that does not have a type is the area for a place that has never been visited.
-- We only delete this one so that we don't delete the rest of its containment.
deleteAreaPlaceLink:
DELETE FROM area_place WHERE area_id IN (
  SELECT a.id
  FROM place p
  INNER JOIN area_place ap ON p.id = ap.place_id
  INNER JOIN area a ON a.id = ap.area_id
  WHERE place_id = :placeId
  AND a.type IS NULL
);

But if we had clicked on the most specific area for the place, there will be no area that has a null type, so we will never delete its area, preventing us from refreshing the place's area if it had changed upstream.

@lydavid
Copy link
Owner Author

lydavid commented Nov 7, 2024

From #1216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant