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
This commit is contained in:
parent
009e812f8c
commit
75b27c5424
|
|
@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS listener_geo_stats (
|
||||||
city VARCHAR(100),
|
city VARCHAR(100),
|
||||||
listener_count INTEGER DEFAULT 0,
|
listener_count INTEGER DEFAULT 0,
|
||||||
listen_minutes 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);
|
CREATE INDEX IF NOT EXISTS idx_geo_stats_date ON listener_geo_stats(date);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue