Skip to content

Commit a354371

Browse files
committed
Migration to allow nesting batches
1 parent 4b5599b commit a354371

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/models/solid_queue/job_batch.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module SolidQueue
44
class JobBatch < Record
55
belongs_to :job, foreign_key: :job_id, optional: true
6+
belongs_to :parent_job_batch, foreign_key: :parent_job_batch_id, class_name: "SolidQueue::JobBatch", optional: true
67
has_many :jobs, foreign_key: :batch_id
78

89
serialize :on_finish_active_job, coder: JSON

db/migrate/20240131013203_create_solid_queue_batch_table.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class CreateSolidQueueBatchTable < ActiveRecord::Migration[7.1]
22
def change
33
create_table :solid_queue_job_batches do |t|
4+
t.references :parent_job_batch, index: true # FIXME: foreign key
45
t.text :on_finish_active_job
56
t.text :on_success_active_job
67
t.text :on_failure_active_job

0 commit comments

Comments
 (0)