fix(postgres): repin parked and queued tasks that still name the root identity

This commit is contained in:
sam committed 2026-10-19 01:45:48 +11:00
1 parent cfd4afd894
commit dba0b278e8
1 file changed
+13
@@ -0,0 +1,13 @@
-- A task pins its workflow definition when it first runs, so parked and queued
-- tasks keep the "identity: root" that 0053 removed from the stored definitions
-- and fail to resolve it on every retry. The digest is the pin's SHA-256.
-- +goose Up
UPDATE tasks
SET workflow_definition_yaml = regexp_replace(workflow_definition_yaml, 'identity: root(?=\n|$)', 'identity: 6f129e29-0e26-5246-99bd-74cb4496203b', 'g'),
workflow_definition_digest = encode(sha256(convert_to(regexp_replace(workflow_definition_yaml, 'identity: root(?=\n|$)', 'identity: 6f129e29-0e26-5246-99bd-74cb4496203b', 'g'), 'UTF8')), 'hex')
WHERE status IN ('parked', 'queued')
AND workflow_definition_yaml ~ 'identity: root(\n|$)';
-- +goose Down
SELECT 1;