fix migration for DBs which did not have _hidden tree created, closes #3536

This commit is contained in:
zadam 2023-01-17 23:13:21 +01:00
parent ef825371cf
commit a3149aecf4
2 changed files with 3 additions and 3 deletions

View File

@ -7,6 +7,6 @@ module.exports = () => {
beccaLoader.load();
// make sure the hidden subtree exists since the subsequent migrations we will move some existing notes into it (share...)
// in previous releases hidden subtree was created lazily
hiddenSubtreeService.checkHiddenSubtree();
hiddenSubtreeService.checkHiddenSubtree(true);
});
};

View File

@ -234,8 +234,8 @@ const HIDDEN_SUBTREE_DEFINITION = {
]
};
function checkHiddenSubtree() {
if (!migrationService.isDbUpToDate()) {
function checkHiddenSubtree(force = false) {
if (!force && !migrationService.isDbUpToDate()) {
// on-delete hook might get triggered during some future migration and cause havoc
log.info("Will not check hidden subtree until migration is finished.");
return;