From 080b8f324be8ed0d231589d63e75d02c6f12736b Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 14 Sep 2023 11:28:06 +0200 Subject: [PATCH] fix migration --- backend/Cargo.lock | 4 ++++ backend/Cargo.toml | 1 + backend/windmill-queue/src/jobs.rs | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 311b5a9f4b..cc014badd9 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -5324,6 +5324,7 @@ checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" dependencies = [ "ahash 0.8.3", "atoi", + "bigdecimal", "byteorder", "bytes", "chrono", @@ -5408,6 +5409,7 @@ checksum = "8ca69bf415b93b60b80dc8fda3cb4ef52b2336614d8da2de5456cc942a110482" dependencies = [ "atoi", "base64 0.21.4", + "bigdecimal", "bitflags 2.4.0", "byteorder", "bytes", @@ -5452,6 +5454,7 @@ checksum = "a0db2df1b8731c3651e204629dd55e52adbae0462fa1bdcbed56a2302c18181e" dependencies = [ "atoi", "base64 0.21.4", + "bigdecimal", "bitflags 2.4.0", "byteorder", "chrono", @@ -5470,6 +5473,7 @@ dependencies = [ "log", "md-5 0.10.5", "memchr", + "num-bigint", "once_cell", "rand 0.8.5", "serde", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 8bff61cc46..0fc68e388e 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -155,6 +155,7 @@ sqlx = { version = "^0", features = [ "chrono", "postgres", "runtime-tokio-rustls", + "bigdecimal" ] } dotenv = "^0" ulid = { version = "^1", features = ["uuid"] } diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 8886391a4a..e3b46336e4 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -252,7 +252,7 @@ pub async fn add_completed_job( .flatten(); let mut tx: QueueTransaction<'_, R> = (rsmq.clone(), db.begin().await?).into(); let job_id = queued_job.id.clone(); - let _duration = sqlx::query_scalar!( + let _duration: i64 = sqlx::query_scalar!( "INSERT INTO completed_job AS cj ( workspace_id , id @@ -388,7 +388,7 @@ pub async fn add_completed_job( ON CONFLICT (id, is_workspace, month_) DO UPDATE SET usage = usage.usage + $3", if premium_workspace { w_id } else { &queued_job.email }, premium_workspace, - additional_usage) + additional_usage as i32) .execute(db) .await .map_err(|e| Error::InternalErr(format!("updating usage: {e}")));