Restore proper incompatible DB message

Fixes #1446
This commit is contained in:
Dan Stillman 2018-04-14 11:38:54 -04:00
parent 0e3071576b
commit 0cc3e64b8a

View file

@ -1549,8 +1549,13 @@ Zotero.Schema = new function(){
return false;
}
if (dbVersion > schemaVersion) {
throw new Error("Zotero '" + schema + "' DB version (" + dbVersion
+ ") is newer than SQL file (" + schemaVersion + ")");
let dbClientVersion = yield Zotero.DB.valueQueryAsync(
"SELECT value FROM settings WHERE setting='client' AND key='lastCompatibleVersion'"
);
throw new Zotero.DB.IncompatibleVersionException(
`Zotero '${schema}' DB version (${dbVersion}) is newer than SQL file (${schemaVersion})`,
dbClientVersion
);
}
let sql = yield _getSchemaSQL(schema);
yield Zotero.DB.executeSQLFile(sql);