From b888e0104412414f1b00d8085062cdf7b36c9f81 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 21 Sep 2016 14:39:40 -0700 Subject: [PATCH] Add an index on message.expireTimer This allows us to query all expiring messages on startup. --- js/database.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/database.js b/js/database.js index 29e8a053..700069b9 100644 --- a/js/database.js +++ b/js/database.js @@ -179,6 +179,16 @@ }); next(); } + }, + { + version: "10.0", + migrate: function(transaction, next) { + console.log('migration 10.0'); + console.log('creating expiring message index'); + var messages = transaction.objectStore('messages'); + messages.createIndex('expire', 'expireTimer', { unique: false }); + next(); + } } ]; }());