Use REPLACE instead of INSERT for ebook schema changes

Follow-up to bdea760 (#3360), which I changed incorrectly
This commit is contained in:
Dan Stillman 2023-08-24 05:08:44 -04:00
parent e3a6508134
commit 075457be45

View file

@ -3451,10 +3451,10 @@ Zotero.Schema = new function(){
}
else if (i == 122) {
await Zotero.DB.queryAsync("INSERT INTO fileTypes VALUES(8, 'ebook')");
await Zotero.DB.queryAsync("INSERT INTO fileTypeMIMETypes VALUES(8, 'application/epub+zip')");
await Zotero.DB.queryAsync("REPLACE INTO fileTypes VALUES(8, 'ebook')");
await Zotero.DB.queryAsync("REPLACE INTO fileTypeMIMETypes VALUES(8, 'application/epub+zip')");
// Incorrect, for compatibility
await Zotero.DB.queryAsync("INSERT INTO fileTypeMIMETypes VALUES(8, 'application/epub')");
await Zotero.DB.queryAsync("REPLACE INTO fileTypeMIMETypes VALUES(8, 'application/epub')");
}
// TEMP: When adding 123, check whether IA.authorName fix in items.js::_loadAnnotations()