diff --git a/server/main-api/README.md b/server/main-api/README.md index 897c9f593..a8282ce81 100644 --- a/server/main-api/README.md +++ b/server/main-api/README.md @@ -72,7 +72,7 @@ cargo install sqlx-cli Migrations can be added using ```bash -sqlx migrate add -r +cargo sqlx migrate add -r ``` ### Adding/editing database queries @@ -81,7 +81,7 @@ To get compiletime guarantees for our queries, we use sqlx. To add/edit a query, you will need to run the following command: ```bash -sqlx migrate run --database-url postgres://postgres:password@localhost:5432/postgres +cargo sqlx migrate run --database-url postgres://postgres:password@localhost:5432/postgres cargo sqlx prepare --database-url postgres://postgres:password@localhost:5432/postgres --workspace ``` diff --git a/server/main-api/src/setup/database/mod.rs b/server/main-api/src/setup/database/mod.rs index 83f411322..56e1c1e9f 100644 --- a/server/main-api/src/setup/database/mod.rs +++ b/server/main-api/src/setup/database/mod.rs @@ -17,9 +17,7 @@ async fn load_data( tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, ) -> Result<(), crate::BoxedError> { info!("deleting old data"); - sqlx::query!("DELETE FROM aliases") - .execute(&mut **tx) - .await?; + sqlx::query!("DELETE FROM aliases").execute(&mut **tx).await?; sqlx::query!("DELETE FROM en").execute(&mut **tx).await?; sqlx::query!("DELETE FROM de").execute(&mut **tx).await?;