mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-12-06 05:04:31 +00:00
Two bounded ranges instead of an OR across first and last hearing: migration 086 adds idx_packets_origin_last_heard. Planguard entries guard both ranges, and the node activity test holds the clock still and runs in CI again.
6 lines
337 B
SQL
6 lines
337 B
SQL
-- Copyright 2026 Beacon Contributors
|
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
-- Node activity finds a node's older packets heard again lately in one range, by their last hearing.
|
|
CREATE INDEX CONCURRENTLY idx_packets_origin_last_heard ON packets USING btree (origin_pubkey, last_heard_at DESC) WHERE (origin_pubkey IS NOT NULL);
|