Add migration to update search tokens

Previous commit changed the token schema slightly so now we need to run
a migration to update existing conversations.

// FREEBIE
This commit is contained in:
lilia 2015-12-04 17:24:37 -08:00
parent 720032bb8e
commit 01593363eb
1 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,18 @@
storage.put('unreadCount', unreadCount);
});
}
},
{
version: "4.0",
migrate: function(transaction, next) {
var all = new Whisper.ConversationCollection();
all.fetch().then(function() {
all.each(function(c) {
c.updateTokens();
c.save();
});
});
}
}
];
}());