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:
parent
720032bb8e
commit
01593363eb
1 changed files with 12 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue