Restore DB table reconciliation during integrity check

But skip it at startup, even if flagged on, if there are schema update
steps to perform, to avoid creating tables that aren't expected to exist
yet.

Originally added in 5b9e6497a but disabled in c4cc44528 and 7a434df53
This commit is contained in:
Dan Stillman 2021-01-17 03:30:00 -05:00
parent a2dc7f23cd
commit 9152012368
4 changed files with 38 additions and 23 deletions

View file

@ -248,9 +248,11 @@ describe("Zotero.Schema", function() {
});
})
it.skip("should repair a missing userdata table", async function () {
it("should create missing tables unless 'skipReconcile' is true", async function () {
await Zotero.DB.queryAsync("DROP TABLE retractedItems");
assert.isFalse(await Zotero.DB.tableExists('retractedItems'));
assert.isTrue(await Zotero.Schema.integrityCheck(false, { skipReconcile: true }));
assert.isFalse(await Zotero.Schema.integrityCheck());
assert.isTrue(await Zotero.Schema.integrityCheck(true));
assert.isTrue(await Zotero.DB.tableExists('retractedItems'));