SQLx cannot run this migration OK (#353)

And also correct a typo
This commit is contained in:
Ellie Huxtable 2022-04-26 18:17:56 +01:00 committed by GitHub
parent d8ef5dd93a
commit f8233bcb63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -1 +0,0 @@
create index concurrently if not exists "history_idx" on history using btree (user_id, timestamp);

View file

@ -99,7 +99,7 @@ impl Database for Postgres {
#[instrument(skip_all)] #[instrument(skip_all)]
async fn get_session_user(&self, token: &str) -> Result<User> { async fn get_session_user(&self, token: &str) -> Result<User> {
sqlx::query_as::<_, User>( 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 inner join sessions
on users.id = sessions.user_id on users.id = sessions.user_id
and sessions.token = $1", and sessions.token = $1",