From 2bd68afe28685786080fcf0b08b528e57a7bd67c Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 30 Jul 2023 20:46:44 +0100 Subject: [PATCH] fix: add an index for expirey --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 92d30b2..05a11b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,9 +80,8 @@ pub async fn db_init(config: &Config) -> Result, Error> { .execute(&pool) .await?; - sqlx::query("CREATE INDEX IF NOT EXISTS index_auth_code ON accounts_new (auth_code)") - .execute(&pool) - .await?; + sqlx::query("CREATE INDEX IF NOT EXISTS index_auth_code ON accounts_new (auth_code)").execute(&pool).await?; + sqlx::query("CREATE INDEX IF NOT EXISTS index_date_expiry ON accounts_new (date_expiry)").execute(&pool).await?; // this is for active use sqlx::query(