Add device_events table and scan history API endpoint

Records a DeviceEvent row on every scan: NewDevice when a device is first
seen, DeviceSeen on subsequent scans. Exposes GET /api/devices/{mac}/events
with pagination, ordered by date descending.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-27 21:22:13 -04:00
co-authored by Claude Sonnet 4.6
parent 47a76c4bf8
commit 888f18603f
9 changed files with 422 additions and 1 deletions
@@ -0,0 +1,8 @@
CREATE TABLE device_events(
id INTEGER PRIMARY KEY,
mac_address TEXT NOT NULL,
created_on TEXT NOT NULL,
event_type TEXT NOT NULL,
ipv4_address TEXT NOT NULL,
vendor TEXT NOT NULL
);