code: function addDeletedOrLocalIndex(txn, callback) {
      var docStore = txn.objectStore(DOC_STORE);
      docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});
  
      docStore.openCursor().onsuccess = function (event) {
        var cursor = event.target.result;
        if (cursor) {
          var metadata = cursor.value;
          var deleted = pouchdbMerge.isDeleted(metadata);
          metadata.deletedOrLocal = deleted ? "1" : "0";
          docStore.put(metadata);
          cursor.continue();
        } else {
          callback();
        }
      };
    }
docs: migration to version 2 unfortunately "deletedOrLocal" is a misnomer now that we no longer store local docs in the main doc-store, but whaddyagonnado