commit 59ef9c89da2eabd682c02e3c9d4d633670b33f64
parent f2e411e7d3751d9010488f64d4fb95589de4ad56
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 2 May 2013 03:06:37 -0400
Fix DB upgrade error after running <=Zotero 4.0.6 on 4.0.7 DB
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
@@ -3311,7 +3311,7 @@ Zotero.Schema = new function(){
fromVersion = 76;
}
- if (fromVersion == toVersion) {
+ if (fromVersion >= toVersion) {
return false;
}
@@ -3326,12 +3326,12 @@ Zotero.Schema = new function(){
// previous revision to that one.
for (var i=fromVersion + 1; i<=toVersion; i++) {
if (i == 77) {
- Zotero.DB.query("CREATE TABLE syncedSettings (\n setting TEXT NOT NULL,\n libraryID INT NOT NULL,\n value NOT NULL,\n version INT NOT NULL DEFAULT 0,\n synced INT NOT NULL DEFAULT 0,\n PRIMARY KEY (setting, libraryID)\n)");
+ Zotero.DB.query("CREATE TABLE IF NOT EXISTS syncedSettings (\n setting TEXT NOT NULL,\n libraryID INT NOT NULL,\n value NOT NULL,\n version INT NOT NULL DEFAULT 0,\n synced INT NOT NULL DEFAULT 0,\n PRIMARY KEY (setting, libraryID)\n)");
Zotero.DB.query("INSERT OR IGNORE INTO syncObjectTypes VALUES (7, 'setting')");
}
if (i == 78) {
- Zotero.DB.query("CREATE INDEX creatorData_name ON creatorData(lastName, firstName)");
+ Zotero.DB.query("CREATE INDEX IF NOT EXISTS creatorData_name ON creatorData(lastName, firstName)");
}
}