From 94bfd39085ab194645646515e5c752633a17d627 Mon Sep 17 00:00:00 2001 From: jude Date: Sat, 17 Sep 2022 13:05:14 +0100 Subject: [PATCH] Patch compilation against live schema --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4cd6a58..aa0d0cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -168,7 +168,12 @@ async fn _main(tx: Sender<()>) -> Result<(), Box> { Pool::connect(&env::var("DATABASE_URL").expect("No database URL provided")).await.unwrap(); let popular_timezones = sqlx::query!( - "SELECT timezone FROM users WHERE timezone IS NOT NULL GROUP BY timezone ORDER BY COUNT(timezone) DESC LIMIT 21" + "SELECT IFNULL(timezone, 'UTC') AS timezone + FROM users + WHERE timezone IS NOT NULL + GROUP BY timezone + ORDER BY COUNT(timezone) DESC + LIMIT 21" ) .fetch_all(&database) .await