Add migration for media gallery indices

This commit is contained in:
Daniel Gasienica 2018-04-11 11:42:06 -04:00
parent 273248d3fd
commit 5f220a7b2c
2 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,16 @@
exports.run = (transaction) => {
const messagesStore = transaction.objectStore('messages');
[
'numAttachments',
'numVisualMediaAttachments',
'numFileAttachments',
].forEach((name) => {
console.log(`Create message attachment metadata index: '${name}'`);
messagesStore.createIndex(
name,
['conversationId', 'received_at', name],
{ unique: false }
);
});
};