signal-desktop/js/modules/migrations/18/index.js
2018-04-25 15:24:50 -04:00

16 lines
406 B
JavaScript

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 }
);
});
};