diff --git a/backend/migrations/20250117124431_v2_job.down.sql b/backend/migrations/20250117124431_v2_job.down.sql index 15a325725e0b9..7964cfa4d5242 100644 --- a/backend/migrations/20250117124431_v2_job.down.sql +++ b/backend/migrations/20250117124431_v2_job.down.sql @@ -17,7 +17,8 @@ ALTER TABLE v2_job DROP COLUMN flow_step CASCADE, DROP COLUMN flow_step_id CASCADE, DROP COLUMN flow_root_job CASCADE, - DROP COLUMN schedule_path CASCADE, + DROP COLUMN trigger CASCADE, + DROP COLUMN trigger_kind CASCADE, DROP COLUMN same_worker CASCADE, DROP COLUMN visible_to_owner CASCADE, DROP COLUMN concurrent_limit CASCADE, diff --git a/backend/migrations/20250117124431_v2_job.up.sql b/backend/migrations/20250117124431_v2_job.up.sql index 602d72f7e1811..9211102d21c20 100644 --- a/backend/migrations/20250117124431_v2_job.up.sql +++ b/backend/migrations/20250117124431_v2_job.up.sql @@ -12,7 +12,8 @@ ALTER TABLE v2_job ADD COLUMN IF NOT EXISTS flow_step INTEGER, ADD COLUMN IF NOT EXISTS flow_step_id VARCHAR(255), ADD COLUMN IF NOT EXISTS flow_root_job UUID, - ADD COLUMN IF NOT EXISTS schedule_path VARCHAR(255), + ADD COLUMN IF NOT EXISTS trigger VARCHAR(255), + ADD COLUMN IF NOT EXISTS trigger_kind trigger_kind, ADD COLUMN IF NOT EXISTS same_worker BOOLEAN DEFAULT FALSE NOT NULL, ADD COLUMN IF NOT EXISTS visible_to_owner BOOLEAN DEFAULT TRUE NOT NULL, ADD COLUMN IF NOT EXISTS concurrent_limit INTEGER, diff --git a/backend/migrations/20250117124743_v2_job_queue_sync.up.sql b/backend/migrations/20250117124743_v2_job_queue_sync.up.sql index 4a2582c9dade1..7853fb9fdbd5a 100644 --- a/backend/migrations/20250117124743_v2_job_queue_sync.up.sql +++ b/backend/migrations/20250117124743_v2_job_queue_sync.up.sql @@ -18,7 +18,7 @@ BEGIN -- __last_ping NEW.__job_kind := job.kind; NEW.__env_id := 0xcafe; -- Magic used bellow. - NEW.__schedule_path := job.schedule_path; + NEW.__schedule_path := job.trigger; NEW.__permissioned_as := job.permissioned_as; -- __flow_status NEW.__raw_flow := job.raw_flow; @@ -55,7 +55,7 @@ CREATE OR REPLACE FUNCTION v2_job_queue_after_insert() RETURNS TRIGGER AS $$ BEG kind, runnable_id, runnable_path, parent_job, script_lang, flow_step, flow_step_id, flow_root_job, - schedule_path, + trigger, tag, same_worker, visible_to_owner, concurrent_limit, concurrency_time_window_s, cache_ttl, timeout, priority, args, pre_run_error, raw_code, raw_lock, raw_flow @@ -83,7 +83,7 @@ CREATE OR REPLACE FUNCTION v2_job_queue_after_insert() RETURNS TRIGGER AS $$ BEG flow_step = EXCLUDED.flow_step, flow_step_id = EXCLUDED.flow_step_id, flow_root_job = EXCLUDED.flow_root_job, - schedule_path = EXCLUDED.schedule_path, + trigger = EXCLUDED.trigger, tag = EXCLUDED.tag, same_worker = EXCLUDED.same_worker, visible_to_owner = EXCLUDED.visible_to_owner, diff --git a/backend/migrations/20250117124744_v2_job_completed_sync.up.sql b/backend/migrations/20250117124744_v2_job_completed_sync.up.sql index e777d0659584d..57e0ddfea5b5a 100644 --- a/backend/migrations/20250117124744_v2_job_completed_sync.up.sql +++ b/backend/migrations/20250117124744_v2_job_completed_sync.up.sql @@ -22,7 +22,7 @@ BEGIN NEW.__canceled := NEW.status = 'canceled'; NEW.__job_kind := job.kind; -- __env_id - NEW.__schedule_path := job.schedule_path; + NEW.__schedule_path := job.trigger; NEW.__permissioned_as := job.permissioned_as; NEW.__raw_flow := job.raw_flow; NEW.__is_flow_step := job.flow_step_id IS NOT NULL; diff --git a/backend/migrations/20250117124748_v2_migrate_from_v1.up.sql b/backend/migrations/20250117124748_v2_migrate_from_v1.up.sql index f75a0b909a8c9..f30bec669b06b 100644 --- a/backend/migrations/20250117124748_v2_migrate_from_v1.up.sql +++ b/backend/migrations/20250117124748_v2_migrate_from_v1.up.sql @@ -16,7 +16,7 @@ INSERT INTO v2_job ( kind, runnable_id, runnable_path, parent_job, script_lang, flow_step_id, flow_root_job, - schedule_path, + trigger, tag, same_worker, visible_to_owner, concurrent_limit, concurrency_time_window_s, cache_ttl, timeout, priority, args, pre_run_error, raw_code, raw_lock, raw_flow @@ -38,7 +38,7 @@ INSERT INTO v2_job ( id, workspace_id, created_at, created_by, permissioned_as, permissioned_as_email, kind, runnable_id, runnable_path, parent_job, script_lang, - schedule_path, + trigger, tag, visible_to_owner, priority, args, raw_code, raw_lock, raw_flow @@ -66,7 +66,7 @@ UPDATE v2_job SET script_lang = v2_job_queue.__language, flow_step_id = v2_job_queue.__flow_step_id, flow_root_job = v2_job_queue.__root_job, - schedule_path = v2_job_queue.__schedule_path, + trigger = v2_job_queue.__schedule_path, tag = v2_job_queue.tag, same_worker = v2_job_queue.__same_worker, visible_to_owner = v2_job_queue.__visible_to_owner, @@ -94,7 +94,7 @@ UPDATE v2_job SET runnable_path = v2_job_completed.__script_path, parent_job = v2_job_completed.__parent_job, script_lang = v2_job_completed.__language, - schedule_path = v2_job_completed.__schedule_path, + trigger = v2_job_completed.__schedule_path, tag = v2_job_completed.__tag, visible_to_owner = v2_job_completed.__visible_to_owner, priority = v2_job_completed.__priority,