Fix attachments with missing rows in itemAttachments
This commit is contained in:
parent
c430baa85d
commit
e4fa5f10b0
1 changed files with 8 additions and 2 deletions
|
@ -1244,8 +1244,7 @@ Zotero.Schema = new function(){
|
||||||
Zotero.DB.query("DELETE FROM version WHERE schema='fulltext'");
|
Zotero.DB.query("DELETE FROM version WHERE schema='fulltext'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1.5
|
// 1.5 Sync Preview
|
||||||
|
|
||||||
if (i==37) {
|
if (i==37) {
|
||||||
// Some data cleanup from the pre-FK-trigger days
|
// Some data cleanup from the pre-FK-trigger days
|
||||||
Zotero.DB.query("DELETE FROM annotations WHERE itemID NOT IN (SELECT itemID FROM items)");
|
Zotero.DB.query("DELETE FROM annotations WHERE itemID NOT IN (SELECT itemID FROM items)");
|
||||||
|
@ -1652,6 +1651,13 @@ Zotero.Schema = new function(){
|
||||||
Zotero.DB.query("UPDATE fulltextItems SET itemID=? WHERE itemID=?", params);
|
Zotero.DB.query("UPDATE fulltextItems SET itemID=? WHERE itemID=?", params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i==38) {
|
||||||
|
var ids = Zotero.DB.columnQuery("SELECT itemID FROM items WHERE itemTypeID=14 AND itemID NOT IN (SELECT itemID FROM itemAttachments)");
|
||||||
|
for each(var id in ids) {
|
||||||
|
Zotero.DB.query("INSERT INTO itemAttachments (itemID, linkMode) VALUES (?, ?)", [id, 3]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateDBVersion('userdata', toVersion);
|
_updateDBVersion('userdata', toVersion);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue