insert into wf_case_deadlines (
case_id, workflow_key, transition_key, deadline
) values (
:case_id, 'publishing_wf', :transition, $dead_sql
)
update
wf_case_deadlines
set
deadline = $new_dead_sql
where
workflow_key = 'publishing_wf'
and
transition_key = :transition
and
case_id = :case_id