{"record":{"id":"5b3f5b3895f6281e","repo":"diegosouzapw/OmniRoute","slug":"migration-deferring-optional-fts5-migrations-on","errorCode":null,"errorMessage":"[Migration] Deferring optional FTS5 migrations on driver ${db.driver}: ${summary}. Memory search will fall back until a SQLite driver with FTS5 support is available.","messagePattern":"\\[Migration\\] Deferring optional FTS5 migrations on driver (.+?): (.+?)\\. Memory search will fall back until a SQLite driver with FTS5 support is available\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/db/migrationRunner.ts","lineNumber":996,"sourceCode":"    }\n    return isMissing;\n  });\n  const deferredUnsupported = pending.filter((migration) =>\n    isDeferredUnsupportedMigration(db, migration)\n  );\n  const actionablePending = pending.filter(\n    (migration) => !deferredUnsupported.some((deferred) => deferred.version === migration.version)\n  );\n\n  if (pending.length === 0) {\n    return 0; // Nothing to do\n  }\n\n  if (deferredUnsupported.length > 0) {\n    const summary = deferredUnsupported\n      .map((migration) => `${migration.version}_${migration.name}`)\n      .join(\", \");\n    console.warn(\n      `[Migration] Deferring optional FTS5 migrations on driver ${db.driver}: ${summary}. ` +\n        `Memory search will fall back until a SQLite driver with FTS5 support is available.`\n    );\n  }\n\n  // ── Safety Check 2: Mass-migration detection (abort if existing DB + many migrations) ──\n  // Skip in test environments where fresh DBs legitimately have many pending migrations.\n  const isTestEnvironment = isAutomatedTestProcess();\n\n  // #3416: resolve the threshold at call time so OMNIROUTE_MAX_PENDING_MIGRATIONS\n  // can override the default (0 disables the check). The abort message below\n  // interpolates this resolved value, so it auto-reflects any override.\n  const maxPendingMigrations = resolveMaxPendingMigrations();\n\n  // #9934: `omniroute setup`'s openOmniRouteDb writes a partial skeleton file\n  // (provider_connections + key_value) that has never had migrations run. When\n  // the first `serve` opens it and auto-seeds only the 001 marker, the applied\n  // set is exactly {001} — which would otherwise look like a wiped existing DB","sourceCodeStart":978,"sourceCodeEnd":1014,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/migrationRunner.ts#L978-L1014","documentation":"Error \"[Migration] Deferring optional FTS5 migrations on driver ${db.driver}: ${summary}. Memory search will fall back until a SQLite driver with FTS5 support is available.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/migrationRunner.ts:996 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}