651 B · text 5af55d9
defmodule GitGud.Repo.Migrations.AddWorkflowJobOutputs do
use Ecto.Migration
@moduledoc """
Adds the `outputs` JSONB column to `workflow_jobs` so we can persist
the key/value map a runner sends via `UpdateTaskRequest.outputs`.
Subsequent jobs in the same WorkflowRun read these via
`${{ needs.<upstream_id>.outputs.<key> }}` — populated server-side
in `build_task/1`'s Task.needs map per the `runner.v1.TaskNeed`
proto.
Storage shape: `%{"key" => "value", ...}`. Empty `{}` for jobs that
don't declare outputs.
"""
def change do
alter table(:workflow_jobs) do
add :outputs, :map, default: %{}
end
end
end