Switch worker to the Ookla CLI (jitter, packet loss, server, ISP, shareable result URL, bytes). Migration 028 enriches speedtest_results + adds a generic app_settings store. New /speedtest page: KPIs, throughput + latency charts, window stats, configurable schedule (reschedulable cron) & low-speed alert threshold, history table. SV card gains ping/jitter + a link through to the page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
999 B
SQL
23 lines
999 B
SQL
-- 028_speedtest_metrics.sql
|
|
-- Enrich speedtest results with the full Ookla metric set + a generic settings
|
|
-- store (reused by the speedtest schedule and, later, theming).
|
|
ALTER TABLE speedtest_results ALTER COLUMN down_mbps DROP NOT NULL;
|
|
ALTER TABLE speedtest_results ALTER COLUMN up_mbps DROP NOT NULL;
|
|
ALTER TABLE speedtest_results
|
|
ADD COLUMN IF NOT EXISTS jitter_ms numeric,
|
|
ADD COLUMN IF NOT EXISTS packet_loss numeric,
|
|
ADD COLUMN IF NOT EXISTS server_name text,
|
|
ADD COLUMN IF NOT EXISTS server_id text,
|
|
ADD COLUMN IF NOT EXISTS isp text,
|
|
ADD COLUMN IF NOT EXISTS result_url text,
|
|
ADD COLUMN IF NOT EXISTS down_bytes bigint,
|
|
ADD COLUMN IF NOT EXISTS up_bytes bigint,
|
|
ADD COLUMN IF NOT EXISTS ok boolean NOT NULL DEFAULT true,
|
|
ADD COLUMN IF NOT EXISTS error text;
|
|
|
|
CREATE TABLE IF NOT EXISTS app_settings (
|
|
key text PRIMARY KEY,
|
|
value jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
updated_at timestamptz NOT NULL DEFAULT now()
|
|
);
|