From 533b5254960f39f3a76426c4709783ccebc9fbfb Mon Sep 17 00:00:00 2001 From: wangdl Date: Fri, 19 Jun 2026 22:10:07 +0800 Subject: [PATCH] fix: schema field corrections for AiAnalysisJob + User MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - User INSERT: add updatedAt=NOW() (NOT NULL, no default) - AiAnalysisJob: retryCount→progress (column doesn't exist) Co-Authored-By: Claude Opus 4.7 --- test/helpers/integration-harness.ts | 2 +- test/m-ai-01-09.worker-int-spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/helpers/integration-harness.ts b/test/helpers/integration-harness.ts index 6c7fb0d..9a9a323 100644 --- a/test/helpers/integration-harness.ts +++ b/test/helpers/integration-harness.ts @@ -172,7 +172,7 @@ export async function dbClose(): Promise { } export async function setupFixtures(dbUrl: string, userId: string, kbId: string, kiId: string, sessionId: string): Promise { - await dbExec(dbUrl, `INSERT IGNORE INTO User (id, email, nickname, role, status) VALUES (?, ?, ?, ?, ?)`, + await dbExec(dbUrl, `INSERT IGNORE INTO User (id, email, nickname, role, status, updatedAt) VALUES (?, ?, ?, ?, ?, NOW())`, [userId, `test-${Date.now()}@zhixi.app`, 'Integration Test', 'USER', 'active']); await dbExec(dbUrl, `INSERT IGNORE INTO KnowledgeBase (id, userId, title) VALUES (?, ?, ?)`, [kbId, userId, 'Test KB']); diff --git a/test/m-ai-01-09.worker-int-spec.ts b/test/m-ai-01-09.worker-int-spec.ts index 90f9ff5..86798f2 100644 --- a/test/m-ai-01-09.worker-int-spec.ts +++ b/test/m-ai-01-09.worker-int-spec.ts @@ -233,8 +233,8 @@ describe('M-AI-01-09 真实集成测试', () => { await new Promise(r => setTimeout(r, 10_000)); const jobRows = await dbQuery(DB_URL, - 'SELECT status, retryCount FROM AiAnalysisJob WHERE id = ?', ['ar-500-test']); - console.log(` Job status: ${(jobRows[0] as any)?.status}, retries: ${(jobRows[0] as any)?.retryCount}`); + 'SELECT status, progress FROM AiAnalysisJob WHERE id = ?', ['ar-500-test']); + console.log(` Job status: ${(jobRows[0] as any)?.status}, retries: ${(jobRows[0] as any)?.progress}`); mockAI.setNormal(); }, 15_000);