fix(migration): no such table "tasks"

This commit is contained in:
Elian Doran 2025-03-02 20:43:52 +02:00
parent 1ca485e4b5
commit 67509bc92f
No known key found for this signature in database

View File

@ -65,8 +65,15 @@ function load() {
new BEtapiToken(row); new BEtapiToken(row);
} }
for (const row of sql.getRows<TaskRow>(`SELECT taskId, parentNoteId, title, dueDate, isDone, isDeleted FROM tasks WHERE isDeleted = 0`)) { try {
new BTask(row); 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;
}
} }
}); });