Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(migration): no such table "tasks"
Elian Doran67509bc92fa7
diff --git a/src/becca/becca_loader.ts b/src/becca/becca_loader.tsindex 862e3e8be6..c4b5329dfd 100644--- a/src/becca/becca_loader.ts+++ b/src/becca/becca_loader.ts@@ -65,8 +65,15 @@ function load() {new BEtapiToken(row);}- for (const row of sql.getRows<TaskRow>(`SELECT taskId, parentNoteId, title, dueDate, isDone, isDeleted FROM tasks WHERE isDeleted = 0`)) {- new BTask(row);+ try {+ for (const row of sql.getRows<TaskRow>(`SELECT taskId, parentNoteId, title, dueDate, isDone, isDeleted FROM tasks WHERE isDeleted = 0`)) {+ new BTask(row);+ }+ } catch (e: any) {+ // Some older migrations trigger becca which would fail since the "tasks" table is not yet defined (didn't reach the right migration).+ if (!(e.message.includes("no such table"))) {+ throw e;+ }}});