Fix wrong table in macro update

This commit is contained in:
Tobias Reisinger 2024-05-02 21:14:28 +02:00
parent 98db89ce03
commit cacd740bd9
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 4 additions and 2 deletions

BIN
Cargo.lock generated

Binary file not shown.

View file

@ -23,7 +23,7 @@ chrono = { version = "0.4", features = ["serde"] }
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio", "macros", "chrono"] } sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio", "macros", "chrono"] }
libsqlite3-sys = { version = "*", features = ["bundled"] } libsqlite3-sys = { version = "*", features = ["bundled"] }
uuid = "1.6" uuid = { version = "1.8", features = ["v4"] }
futures = "0.3" futures = "0.3"
libc = "0.2" libc = "0.2"

View file

@ -1,3 +1,5 @@
export DATABASE_URL=sqlite://${PWD}/emgauwa-dev.sqlite
sqlx: sqlx:
cargo sqlx database drop -y cargo sqlx database drop -y
cargo sqlx database create cargo sqlx database create

View file

@ -97,7 +97,7 @@ impl DbMacro {
conn: &mut PoolConnection<Sqlite>, conn: &mut PoolConnection<Sqlite>,
new_name: &str, new_name: &str,
) -> Result<DbMacro, DatabaseError> { ) -> Result<DbMacro, DatabaseError> {
sqlx::query!("UPDATE relays SET name = ? WHERE id = ?", new_name, self.id,) sqlx::query!("UPDATE macros SET name = ? WHERE id = ?", new_name, self.id,)
.execute(conn.deref_mut()) .execute(conn.deref_mut())
.await?; .await?;