27 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
28 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
29 Components.utils.import(
"resource://app/jsmodules/sbLocalDatabaseMigrationUtils.jsm");
30 Components.utils.import(
"resource://app/jsmodules/SBJobUtils.jsm");
32 const Cc = Components.classes;
33 const Ci = Components.interfaces;
34 const Cr = Components.results;
37 dump(
"----++++----++++sbLibraryMigration " +
40 "\n----++++----++++\n");
45 SBLocalDatabaseMigrationUtils.BaseMigrationHandler.call(
this);
47 this.fromVersion = 12;
56 __proto__: SBLocalDatabaseMigrationUtils.BaseMigrationHandler.prototype,
58 classID: Components.ID(
"{98aafd32-9ed8-4a67-9cb6-1d8babe3c0c9}"),
59 contractID: SBLocalDatabaseMigrationUtils.baseHandlerContractID +
' 12 to 13',
61 _databaseLocation:
null,
64 migrate:
function sbLibraryMigration_migrate(aLibrary) {
66 this._databaseGUID = aLibrary.databaseGuid;
67 this._databaseLocation = aLibrary.databaseLocation;
69 var query = this._createQuery();
72 query.addQuery(
"alter table resource_properties add obj_searchable text");
75 query.addQuery(
"update library_metadata set value = '"
76 + this.toVersion +
"' where name = 'version'");
77 query.addQuery(
"commit");
80 query.addQuery(
"VACUUM");
83 query.setAsyncQuery(
true);
84 query.execute(retval);
90 var
prefs =
Cc[
"@mozilla.org/preferences-service;1"]
91 .getService(
Ci.nsIPrefBranch);
92 prefs.setBoolPref(
"songbird.propertycache." +
93 this._databaseGUID +
".invalidSortData",
true);
94 prefs.QueryInterface(
Ci.nsIPrefService).savePrefFile(
null);
97 dump(
"Exception occured: " + e);
102 _createQuery:
function sbLibraryMigration_createQuery() {
103 var query =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
104 .createInstance(
Ci.sbIDatabaseQuery);
105 query.databaseLocation = this._databaseLocation;
106 query.setDatabaseGUID(this._databaseGUID);
117 return XPCOMUtils.generateModule([
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function sbLibraryMigration()
sbDeviceFirmwareAutoCheckForUpdate prototype classID
function NSGetModule(compMgr, fileSpec)