From 5c7d185953020f813b3cdc1d3ba98d2b077c3873 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sun, 26 Apr 2026 16:40:24 +0800 Subject: [PATCH] fix: update mock database schema to match conversation tracker queries - Add missing columns: slug, model, conversation_count, total_messages, total_tokens, created_at, project_path - Fix test data insert to include all required columns Co-Authored-By: Claude Sonnet 4.6 --- dashboard/backend/tests/conftest.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dashboard/backend/tests/conftest.py b/dashboard/backend/tests/conftest.py index ad3661c..da3c87c 100644 --- a/dashboard/backend/tests/conftest.py +++ b/dashboard/backend/tests/conftest.py @@ -304,10 +304,12 @@ def mock_conversation_db(tmp_path, monkeypatch): CREATE TABLE conversations ( session_id TEXT PRIMARY KEY, project_path TEXT, + slug TEXT, started_at DATETIME, message_count INTEGER, total_input_tokens INTEGER DEFAULT 0, - total_output_tokens INTEGER DEFAULT 0 + total_output_tokens INTEGER DEFAULT 0, + model TEXT ) """) conn.execute(""" @@ -332,14 +334,19 @@ def mock_conversation_db(tmp_path, monkeypatch): CREATE TABLE daily_summaries ( id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT UNIQUE NOT NULL, - summary_content TEXT NOT NULL + summary_content TEXT NOT NULL, + conversation_count INTEGER DEFAULT 0, + total_messages INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + created_at DATETIME, + project_path TEXT ) """) # Insert test data conn.execute(""" INSERT INTO conversations VALUES - ('test-session-id', '/test/project', '2026-04-19 10:00:00', 10, 1000, 500) + ('test-session-id', '/test/project', 'test-slug', '2026-04-19 10:00:00', 10, 1000, 500, 'claude-sonnet-4') """) conn.execute(""" INSERT INTO messages VALUES