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:
parent
b29e504bb3
commit
009e812f8c
|
|
@ -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, city)
|
UNIQUE(date, country_code)
|
||||||
);
|
);
|
||||||
|
|
||||||
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