Patch compilation against live schema

This commit is contained in:
jude 2022-09-17 13:03:52 +01:00
parent 133b00a2ce
commit 40cd5f8a36
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
Pool::connect(&env::var("DATABASE_URL").expect("No database URL provided")).await.unwrap();
let popular_timezones = sqlx::query!(
"SELECT timezone FROM users GROUP BY timezone ORDER BY COUNT(timezone) DESC LIMIT 21"
"SELECT timezone FROM users WHERE timezone IS NOT NULL GROUP BY timezone ORDER BY COUNT(timezone) DESC LIMIT 21"
)
.fetch_all(&database)
.await

View File

@ -22,7 +22,7 @@ impl UserData {
match sqlx::query!(
"
SELECT timezone FROM users WHERE user = ?
SELECT IFNULL(timezone, 'UTC') AS timezone FROM users WHERE user = ?
",
user_id
)