Fix redundant Number on Dataset item type
This commit is contained in:
parent
9ce8855fa4
commit
860e901240
4 changed files with 14 additions and 5 deletions
|
@ -556,7 +556,7 @@ Zotero.Items = function() {
|
|||
}
|
||||
catch (e) {
|
||||
if (e.message.includes('no such column: IA.authorName')
|
||||
&& await Zotero.DB.valueQueryAsync("SELECT COUNT(*) FROM version WHERE schema='userdata' AND version=120")) {
|
||||
&& await Zotero.DB.valueQueryAsync("SELECT COUNT(*) FROM version WHERE schema='userdata' AND version IN (120, 121)")) {
|
||||
await Zotero.DB.queryAsync("UPDATE version SET version=119 WHERE schema='userdata'");
|
||||
Zotero.crash();
|
||||
}
|
||||
|
|
|
@ -3466,8 +3466,17 @@ Zotero.Schema = new function(){
|
|||
}
|
||||
}
|
||||
|
||||
// TEMP: When adding 121, check whether IA.authorName fix in items.js::_loadAnnotations()
|
||||
// should be updated
|
||||
else if (i == 121) {
|
||||
let datasetItemTypeID = await Zotero.DB.valueQueryAsync("SELECT itemTypeID FROM itemTypes WHERE typeName='dataset'");
|
||||
let numberFieldID = await Zotero.DB.valueQueryAsync("SELECT fieldID FROM fields WHERE fieldName='number'");
|
||||
if (datasetItemTypeID && numberFieldID) {
|
||||
await Zotero.DB.queryAsync("DELETE FROM itemData WHERE fieldID=? AND itemID IN (SELECT itemID FROM items WHERE itemTypeID=?)", [numberFieldID, datasetItemTypeID]);
|
||||
await Zotero.DB.queryAsync("DELETE FROM itemTypeFields WHERE itemTypeID=? AND fieldID=?", [datasetItemTypeID, numberFieldID]);
|
||||
}
|
||||
}
|
||||
|
||||
// TEMP: When adding 122, check whether IA.authorName fix in items.js::_loadAnnotations()
|
||||
// can be updated due to update steps being indempodent
|
||||
|
||||
// If breaking compatibility or doing anything dangerous, clear minorUpdateFrom
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b0918becbad9e371e21affde32850c649c6bde8e
|
||||
Subproject commit 1b12272d44134a652519e9192e5a936ac9fcd707
|
|
@ -1,4 +1,4 @@
|
|||
-- 120
|
||||
-- 121
|
||||
|
||||
-- Copyright (c) 2009 Center for History and New Media
|
||||
-- George Mason University, Fairfax, Virginia, USA
|
||||
|
|
Loading…
Reference in a new issue