Class: AddChronoForgeParentExecutionLog

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/chrono_forge/templates/add_chrono_forge_parent_execution_log.rb

Overview

Adds chrono_forge_workflows.parent_execution_log_id: the execution log that spawned a workflow (for branches, the branch$<name> log). Deliberately generic so any future step that spawns sub-workflows can reuse it. The composite

parent_execution_log_id, state

index makes the merge completion probe and the

dropped-job re-kick index-only at hundreds of thousands of children.

Shipped standalone (matching add_chrono_forge_workflow_state_index) so existing installs pick it up via ‘rails generate chrono_forge:upgrade`.

Instance Method Summary collapse

Instance Method Details

#changeObject



14
15
16
17
18
19
20
# File 'lib/generators/chrono_forge/templates/add_chrono_forge_parent_execution_log.rb', line 14

def change
  add_column :chrono_forge_workflows, :parent_execution_log_id, parent_log_fk_type,
    null: true, if_not_exists: true

  add_index :chrono_forge_workflows, %i[parent_execution_log_id state],
    if_not_exists: true, **chrono_forge_index_algorithm
end