Add IF EXISTS to DROP statements in schema update steps

https://forums.zotero.org/discussion/80291/zotero-standalone-wont-open-database-upgrade-error
This commit is contained in:
Dan Stillman 2019-12-02 12:22:46 -07:00
parent 4883104bd2
commit d9edf2965a

View file

@ -2880,16 +2880,16 @@ Zotero.Schema = new function(){
else if (i == 106) {
yield _updateCompatibility(6);
yield Zotero.DB.queryAsync("DROP TRIGGER insert_date_field");
yield Zotero.DB.queryAsync("DROP TRIGGER update_date_field");
yield Zotero.DB.queryAsync("DROP TRIGGER fki_itemAttachments");
yield Zotero.DB.queryAsync("DROP TRIGGER fku_itemAttachments");
yield Zotero.DB.queryAsync("DROP TRIGGER fki_itemNotes");
yield Zotero.DB.queryAsync("DROP TRIGGER fku_itemNotes");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS insert_date_field");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS update_date_field");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS fki_itemAttachments");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS fku_itemAttachments");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS fki_itemNotes");
yield Zotero.DB.queryAsync("DROP TRIGGER IF EXISTS fku_itemNotes");
yield Zotero.DB.queryAsync("DROP TABLE transactionSets");
yield Zotero.DB.queryAsync("DROP TABLE transactions");
yield Zotero.DB.queryAsync("DROP TABLE transactionLog");
yield Zotero.DB.queryAsync("DROP TABLE IF EXISTS transactionSets");
yield Zotero.DB.queryAsync("DROP TABLE IF EXISTS transactions");
yield Zotero.DB.queryAsync("DROP TABLE IF EXISTS transactionLog");
}
// If breaking compatibility or doing anything dangerous, clear minorUpdateFrom