added tag field, needed for postgres RLS

This commit is contained in:
yacine Bouraroui
2024-10-01 12:41:19 +02:00
parent c7a327e1d8
commit 698375cb17
3 changed files with 9 additions and 4 deletions
@@ -0,0 +1,2 @@
-- Add down migration script here
ALTER TABLE job_params DROP COLUMN tag;
@@ -0,0 +1,2 @@
-- Add up migration script here
ALTER TABLE job_params ADD COLUMN tag VARCHAR(50);
+5 -4
View File
@@ -3944,7 +3944,7 @@ pub async fn push<'c, 'd, R: rsmq_async::RsmqConnection + Send + 'c>(
email,
visible_to_owner,
root_job,
tag,
tag.clone(),
concurrent_limit,
if concurrent_limit.is_some() { concurrency_time_window_s } else { None },
custom_timeout,
@@ -3959,13 +3959,14 @@ pub async fn push<'c, 'd, R: rsmq_async::RsmqConnection + Send + 'c>(
// insert into args queue
sqlx::query!(
r#"
INSERT INTO job_params (id, args, raw_code, raw_flow)
VALUES ($1, $2, $3, $4)
INSERT INTO job_params (id, args, raw_code, raw_flow, tag)
VALUES ($1, $2, $3, $4, $5)
"#,
uuid,
args as Json<PushArgs>,
raw_code,
raw_flow as Option<Json<FlowValue>>
raw_flow as Option<Json<FlowValue>>,
tag
)
.execute(&mut tx)
.await?;