use a cursor when updating versions
use a cursor when updating versions

this makes the query time lots faster

refs CORE-2561

test plan
 - specs should pass

Change-Id: I4f2f747d6255e3422dcf1b87efe24af51a7d0619
Reviewed-on: https://gerrit.instructure.com/184905
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
QA-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
Product-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>

instructure/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,djbender/canvas-lms,instructure/canvas-lms,djbender/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,djbender/canvas-lms,sfu/canvas-lms,djbender/canvas-lms