should be renamed to upgradeDB, upgradeNeeded ... something like that

I think it would be cleaner to have seperate functions per upgrade

    var currentVersion = e.oldVersion;
    while (currentVersion !== e.newVersion) {
      if (currentVersion === 0) {
        createSchema(db);
      } else if (currentVersion) { 
         updateSearchEngine(db);
      }
      currentVersion++;
    }

but thats a minor nit