From 22a9fb2cb18e106bcd26aa7edef87ec63679e3a4 Mon Sep 17 00:00:00 2001 From: nathants Date: Mon, 14 Jul 2025 10:28:24 -1000 Subject: [PATCH] fix: sqlite migrations should ran after the table is created --- core/indexing/docs/DocsService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/indexing/docs/DocsService.ts b/core/indexing/docs/DocsService.ts index 0ccb4804e..1399dd957 100644 --- a/core/indexing/docs/DocsService.ts +++ b/core/indexing/docs/DocsService.ts @@ -968,7 +968,6 @@ export default class DocsService { await db.exec("PRAGMA busy_timeout = 3000;"); - await runSqliteMigrations(db); // First create the table if it doesn't exist await db.exec(`CREATE TABLE IF NOT EXISTS ${DocsService.sqlitebTableName} ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -978,6 +977,8 @@ export default class DocsService { embeddingsProviderId STRING )`); + await runSqliteMigrations(db); + this.sqliteDb = db; }