'Upgrade the database to the current version'

def do_database_upgrade(self, request):

    try:
        driver.mgr.db.upgrade()
    except DatabaseError as ex:
        errmsg = ('Could    not    upgrade    your    Code    Intelligence    Database    because:    %s.    Your    database    will    be    backed    up    and    a    new    empty    database    will    be    created.' % ex)
        driver.exception(message=errmsg)
    except:
        errmsg = 'Unexpected    error    upgrading    your    database.    Your    database    will    be    backed    up    and    a    new    empty    database    will    be    created.'
        driver.exception(message=errmsg, detail=traceback.format_exc())
    else:
        driver.send()
