Skip to content

Commit

Permalink
Add migration to update search tokens
Browse files Browse the repository at this point in the history
Previous commit changed the token schema slightly so now we need to run
a migration to update existing conversations.

// FREEBIE
  • Loading branch information
liliakai committed Dec 10, 2015
1 parent 720032b commit 0159336
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
}
}
];
}());

0 comments on commit 0159336

Please sign in to comment.