fix migration

This commit is contained in:
Ruben Fiszel
2023-09-14 11:28:06 +02:00
parent 2c00894122
commit 080b8f324b
3 changed files with 7 additions and 2 deletions
+4
View File
@@ -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",
+1
View File
@@ -155,6 +155,7 @@ sqlx = { version = "^0", features = [
"chrono",
"postgres",
"runtime-tokio-rustls",
"bigdecimal"
] }
dotenv = "^0"
ulid = { version = "^1", features = ["uuid"] }
+2 -2
View File
@@ -252,7 +252,7 @@ pub async fn add_completed_job<R: rsmq_async::RsmqConnection + Clone + Send>(
.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<R: rsmq_async::RsmqConnection + Clone + Send>(
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}")));