Fix listener_geo_stats unique constraint to match code

The ON CONFLICT clause uses (date, country_code) but the table had
UNIQUE(date, country_code, city). Changed to UNIQUE(date, country_code).
This commit is contained in:
Glenn Thompson 2025-12-12 19:13:25 +03:00 committed by Brian O'Reilly
parent b29e504bb3
commit 009e812f8c
1 changed files with 1 additions and 1 deletions

View File

@ -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, city)
UNIQUE(date, country_code)
);
CREATE INDEX IF NOT EXISTS idx_geo_stats_date ON listener_geo_stats(date);