From f8233bcb635062f002e75aedcc50181a8573fc58 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 26 Apr 2022 18:17:56 +0100 Subject: [PATCH] SQLx cannot run this migration OK (#353) And also correct a typo --- atuin-server/migrations/20220426080938_history-index.sql | 1 - atuin-server/src/database.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 atuin-server/migrations/20220426080938_history-index.sql diff --git a/atuin-server/migrations/20220426080938_history-index.sql b/atuin-server/migrations/20220426080938_history-index.sql deleted file mode 100644 index 2d2a563..0000000 --- a/atuin-server/migrations/20220426080938_history-index.sql +++ /dev/null @@ -1 +0,0 @@ -create index concurrently if not exists "history_idx" on history using btree (user_id, timestamp); diff --git a/atuin-server/src/database.rs b/atuin-server/src/database.rs index d7afeea..1a3e33b 100644 --- a/atuin-server/src/database.rs +++ b/atuin-server/src/database.rs @@ -99,7 +99,7 @@ impl Database for Postgres { #[instrument(skip_all)] async fn get_session_user(&self, token: &str) -> Result { sqlx::query_as::<_, User>( - "select users.id, users.username, user.email, users.password from users + "select users.id, users.username, users.email, users.password from users inner join sessions on users.id = sessions.user_id and sessions.token = $1",