commit 3a5490a1ef7cff1d9a82405224a22bee6c73b55b
parent 0d8643087a3b39c929328288e5b8269a76ad971e
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 2 Mar 2017 01:31:38 -0500
If userID is set, migrate any item relations with local user key
DB update to go along with 0d8643087a
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
@@ -2371,6 +2371,13 @@ Zotero.Schema = new function(){
else if (i == 91) {
yield Zotero.DB.queryAsync("ALTER TABLE libraries ADD COLUMN archived INT NOT NULL DEFAULT 0");
}
+
+ else if (i == 92) {
+ let userID = yield Zotero.DB.valueQueryAsync("SELECT value FROM settings WHERE setting='account' AND key='userID'");
+ if (userID) {
+ yield Zotero.DB.queryAsync("UPDATE itemRelations SET object='http://zotero.org/users/' || ? || SUBSTR(object, 39) WHERE object LIKE ?", [userID, 'http://zotero.org/users/local/%']);
+ }
+ }
}
yield _updateDBVersion('userdata', toVersion);
diff --git a/resource/schema/userdata.sql b/resource/schema/userdata.sql
@@ -1,4 +1,4 @@
--- 91
+-- 92
-- Copyright (c) 2009 Center for History and New Media
-- George Mason University, Fairfax, Virginia, USA