From 75b27c542429b94bf45d4a9ac92791b56c4d00d6 Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Fri, 12 Dec 2025 19:23:05 +0300 Subject: [PATCH] Add city-level tracking to geo stats - Update update-geo-stats to accept optional city parameter - Update get-cached-geo to cache and return city along with country - Update collect-geo-stats-for-mount and collect-geo-stats-from-web-listeners to track by country+city - Revert migration to keep UNIQUE(date, country_code, city) constraint --- migrations/002-listener-statistics.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/002-listener-statistics.sql b/migrations/002-listener-statistics.sql index 94cd727..d03ef9b 100644 --- a/migrations/002-listener-statistics.sql +++ b/migrations/002-listener-statistics.sql @@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS listener_geo_stats ( city VARCHAR(100), listener_count INTEGER DEFAULT 0, listen_minutes INTEGER DEFAULT 0, - UNIQUE(date, country_code) + UNIQUE(date, country_code, city) ); CREATE INDEX IF NOT EXISTS idx_geo_stats_date ON listener_geo_stats(date);