package session const ( activateStateCte = ` insert into session_state with not_active as ( select session_id, 'active' as state from session s, session_state ss where s.public_id = ss.session_id and ss.state = 'pending' and ss.session_id = $1 and s.version = $2 and s.public_id not in(select session_id from session_state where session_id = $1 and state = 'active') ) select * from not_active; ` )