| 1 | -- SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | -- |
| 3 | -- S41a-M2 audit follow-up: add step_with column to workflow_steps. |
| 4 | -- |
| 5 | -- The parser populates Step.With map[string]Value with the YAML |
| 6 | -- `with:` block contents — forwarded to the runner's alias-specific |
| 7 | -- step (e.g., shithub/upload-artifact@v1's `name:`+`path:` inputs). |
| 8 | -- Migration 0044 had no column to persist this, so the parser model |
| 9 | -- diverged from the schema; S41b/c couldn't INSERT a step with |
| 10 | -- `with:` data. |
| 11 | -- |
| 12 | -- Adds the column with a default empty object so existing inserts |
| 13 | -- (the InsertWorkflowStep query updated in this PR) keep working, |
| 14 | -- and so any rows created before this migration runs (none in |
| 15 | -- production yet — S41b hasn't started) backfill harmlessly. |
| 16 | -- |
| 17 | -- Defaulted, NOT NULL, jsonb. Same shape as step_env. |
| 18 | |
| 19 | -- +goose Up |
| 20 | |
| 21 | ALTER TABLE workflow_steps |
| 22 | ADD COLUMN step_with jsonb NOT NULL DEFAULT '{}'::jsonb; |
| 23 | |
| 24 | |
| 25 | -- +goose Down |
| 26 | |
| 27 | ALTER TABLE workflow_steps |
| 28 | DROP COLUMN step_with; |
| 29 |