'Fetch database version
:return: Integer inidicating current DB version'

def check_db_major_version(self):

    result = None
    try:
        if self.hasTable(u'db_version'):
            result = self.select(u'SELECT    db_version    FROM    db_version')
    except Exception:
        return 0
    if result:
        return int(result[0]['db_version'])
    else:
        return 0
