Skip to content

Commit

Permalink
Merge pull request #7767 from ehuelsmann/fix/master/missing-aa-trx-wo…
Browse files Browse the repository at this point in the history
…rkflows

Create required workflow context
  • Loading branch information
ehuelsmann committed Dec 3, 2023
2 parents c71a986 + 3b1eab6 commit 7ee03c0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sql/changes/1.11/workflow-for-aa-transactions.sql
Expand Up @@ -15,6 +15,15 @@ new_workflow AS (
now() as last_update
FROM aa_transactions
RETURNING workflow_id, state, last_update
),
new_context AS (
INSERT INTO workflow_context
SELECT workflow_id, jsonb_build_object( 'is_transaction', 1,
'transdate', transdate,
'table_name', table_name)
FROM new_workflow
JOIN aa_transactions USING (workflow_id)
RETURNING workflow_id
)
INSERT INTO workflow_history
SELECT nextval('workflow_History_seq') as workflow_hist_id,
Expand All @@ -24,4 +33,4 @@ SELECT nextval('workflow_History_seq') as workflow_hist_id,
state,
'<upgrade>' as workflow_user,
last_update as history_date
FROM new_workflow;
FROM new_context JOIN new_workflow USING (workflow_id);

0 comments on commit 7ee03c0

Please sign in to comment.