tenseleyflow/shithub / 0af21cf

Browse files

migration 0050: workflow_steps.step_with column (S41a-M2)

ALTER TABLE workflow_steps ADD COLUMN step_with jsonb NOT NULL
DEFAULT '{}'::jsonb. Closes the gap between the parser's
Step.With map[string]Value field and the schema, which had no
column to persist it. S41b/c can now INSERT a step with the
forwarded action-input bag intact.

Default empty object so any pre-migration rows backfill harmlessly
(none in production yet — S41b hasn't started). Same shape as
step_env.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
0af21cf3e064b215506de7083844b79ad2e9c274
Parents
d3f7574
Tree
e286da8

1 changed file

StatusFile+-
A internal/migrationsfs/migrations/0050_workflow_steps_step_with.sql 28 0
internal/migrationsfs/migrations/0050_workflow_steps_step_with.sqladded
@@ -0,0 +1,28 @@
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;