Bug 883770 - [Dialer][SMS][Contacts] Call log does no longer show contact names after version upgrade. r=gwagner

This commit is contained in:
Michael Henretty 2013-07-01 19:13:45 +08:00
parent fcbb207da3
commit 18a16d43cb

View File

@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/IndexedDBHelper.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
const DB_NAME = "contacts";
const DB_VERSION = 11;
const DB_VERSION = 12;
const STORE_NAME = "contacts";
const SAVED_GETALL_STORE_NAME = "getallcache";
const CHUNK_SIZE = 20;
@ -327,7 +327,15 @@ ContactDB.prototype = {
}
};
} else if (currVersion == 9) {
// no-op, see https://bugzilla.mozilla.org/show_bug.cgi?id=883770#c16
} else if (currVersion == 10) {
if (DEBUG) debug("Adding object store for database revision");
db.createObjectStore(REVISION_STORE).put(0, REVISION_KEY);
} else if (currVersion == 11) {
if (DEBUG) debug("Add a telMatch index with national and international numbers");
if (!objectStore) {
objectStore = aTransaction.objectStore(STORE_NAME);
}
objectStore.createIndex("telMatch", "search.parsedTel", {multiEntry: true});
objectStore.openCursor().onsuccess = function(event) {
let cursor = event.target.result;
@ -351,13 +359,10 @@ ContactDB.prototype = {
cursor.continue();
}
};
} else if (currVersion == 10) {
if (DEBUG) debug("Adding object store for database revision");
db.createObjectStore(REVISION_STORE).put(0, REVISION_KEY);
}
// Increment the DB revision on future schema changes as well
if (currVersion > 10) {
if (currVersion > 11) {
this.incrementRevision(aTransaction);
}
}