Fixing conditions for required_actions to work with Postgresql as well