Advertisement
Dyrcona

Reset stuck autorenewals

Dec 17th, 2021
1,599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. update action_trigger.event
  2. set state = 'pending'
  3. where id in (select event.id
  4. from action_trigger.event
  5. left join action.circulation
  6. on circulation.parent_circ = event.target
  7. where event_def = <autorenewal_event_id>
  8. and add_time::date = now()::date
  9. and state <> 'complete' and state <> 'error'
  10. and state <> 'invalid'
  11. and circulation is null);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement