Disable creation of missing tables/indexes in Schema.integrityCheck()

Originally added in 5b9e6497a. We stopped running the integrity check
before userdata upgrades in c4cc44528 because this new behavior was
breaking upgrades, but it could still be run when coming from the DB
Repair Tool, which could cause problems if, say, you recovered a
database from a computer that had an older version of Zotero and ran the
DB Repair Tool on it. Disabling this for now until we have a better
solution.
This commit is contained in:
Dan Stillman 2020-12-21 01:50:13 -05:00
parent 43e6493997
commit 7a434df539
2 changed files with 8 additions and 1 deletions

View file

@ -1758,6 +1758,12 @@ Zotero.Schema = new function(){
// error, and either true or data to pass to the repair function on error. Functions should
// avoid assuming any global state (e.g., loaded data).
var checks = [
/*
Currently disabled, because it can cause problems with schema update steps that don't
expect tables to exist.
The test "should repair a missing userdata table" is also disabled.
// Create any tables or indexes that are missing and delete any tables or triggers that
// still exist but should have been deleted
[
@ -1831,6 +1837,7 @@ Zotero.Schema = new function(){
}
}
],
*/
// Foreign key checks
[

View file

@ -248,7 +248,7 @@ describe("Zotero.Schema", function() {
});
})
it("should repair a missing userdata table", async function () {
it.skip("should repair a missing userdata table", async function () {
await Zotero.DB.queryAsync("DROP TABLE retractedItems");
assert.isFalse(await Zotero.DB.tableExists('retractedItems'));
assert.isFalse(await Zotero.Schema.integrityCheck());