Files
beacon-server/db/migrations/043_clear_zero_locations.sql
T
MrAlders0n 689bc2326a fix(ingest): clear a node's location on an explicit 0/0 advert
A repeater that advertises 0/0 is hiding its position. It was stored as a literal 0/0 that every consumer had to special-case; now the stored latitude, longitude and location source are cleared, an omitted location still preserves the stored one, and the nodeUpdate event sends explicit null lat/lng so clients can clear too. Migration 043 drops rows stored as 0/0 before this change.
2026-09-30 11:29:01 -04:00

7 lines
348 B
SQL

-- Copyright 2026 Beacon Contributors
-- SPDX-License-Identifier: AGPL-3.0-or-later
-- An explicit 0/0 advert now clears the stored position; drop old 0/0 rows and stale sources.
UPDATE nodes SET latitude = NULL, longitude = NULL, location_source = NULL
WHERE location_source = 'advert' AND (latitude IS NULL OR (latitude = 0 AND longitude = 0));