Updated sql for new hooks

Fixed sql script