From 009e812f8cee86ee922745e0a31b0779fbc22774 Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Fri, 12 Dec 2025 19:13:25 +0300 Subject: [PATCH] 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). --- 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 d03ef9b..94cd727 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, city) + UNIQUE(date, country_code) ); CREATE INDEX IF NOT EXISTS idx_geo_stats_date ON listener_geo_stats(date);