Files
nym/nym-statistics-api/migrations/004_sessions_exit_cc.sql
Simon Wicky 50bc3babb7 [Stats API] Active device endpoint and exit country code (#6265)
* active_device endpoint and exit_cc in report

* bump stats API version

* stats API version in lockflie

* migration changes
2025-12-04 11:00:51 +01:00

32 lines
1.1 KiB
SQL

-- IMPORTANT : At the time of writing this, there are no instances of the Stats API with data in that table. Dropping it to modify is therefore fine
DROP TABLE report_v2;
CREATE TABLE report_v2 (
-- some info about the report, inferred from when/from where we got it
received_at TIMESTAMP WITH TIME ZONE NOT NULL,
source_ip TEXT,
from_mixnet BOOLEAN,
country_code TEXT,
report_version TEXT,
-- some infos about the device sending the report
device_id TEXT NOT NULL,
os_type TEXT,
os_version TEXT,
architecture TEXT,
app_version TEXT,
user_agent TEXT,
-- session info
start_day_utc DATE,
connection_time_ms INTEGER,
tunnel_type TEXT,
retry_attempt INTEGER,
session_duration_min INTEGER,
disconnection_time_ms INTEGER,
exit_id TEXT,
exit_cc TEXT, -- new column
follow_up_id TEXT,
error TEXT
);