Add retention policy for device_events and notifications

Purges records older than a configurable window (default 365d) once per day.
Also adds a composite index on device_events(mac_address, created_on DESC) for
efficient scan history queries at scale, and fixes a non-deterministic pagination
order by adding id as a tiebreaker to ORDER BY.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-28 09:00:36 -04:00
co-authored by Claude Sonnet 4.6
parent 888f18603f
commit c7e1678407
8 changed files with 197 additions and 10 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/sh
sudo rm -f oott.db
sudo CARGO_HOME=$HOME/.cargo cargo test -- --show-output
sudo CARGO_HOME=$HOME/.cargo cargo test -- --show-output --test-threads=1