trilium/db/migrations/0204__migrate_bookmarks_to_clones.js

17 lines
555 B
JavaScript
Raw Normal View History

2022-12-05 03:05:18 +08:00
module.exports = () => {
const cls = require("../../src/services/cls");
const cloningService = require("../../src/services/cloning");
const beccaLoader = require("../../src/becca/becca_loader");
const becca = require("../../src/becca/becca");
cls.init(() => {
beccaLoader.load();
for (const attr of becca.findAttributes('label','bookmarked')) {
2022-12-07 06:48:44 +08:00
cloningService.toggleNoteInParent(true, attr.noteId, 'lbBookmarks');
2022-12-05 03:05:18 +08:00
attr.markAsDeleted("0204__migrate_bookmarks_to_clones");
}
});
};