mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-02 01:29:58 +08:00
fix(test): 去掉 botLifecycleService fixture 里重复的 mcp_app_view_states 建表
该测试的内存 SQLite fixture 里 mcp_app_view_states 被建了两次:靠前那份带 REFERENCES messages(id) ON DELETE CASCADE(与 localDb/schema.ts 的真实表一致), 靠后那份没有外键。SQLite 遇到第二句直接报 "table mcp_app_view_states already exists",createDatabase() 抛异常,该文件 33 个用例全红。 上游为修 #10182 的 "no such table" 加的建表语句与 fixture 里原有的一张表重复, 于是 main 的 client-ci(run 43249901687)也红在这个文件上,并连带挡住其它改 register.ts 的 PR 的 CI。 只删掉重复的那一份(5 行),保留与真实 schema 一致的建表语句;断言与生产代码 均未改动。修改前该文件 33 failed,修改后 33 passed。 Signed-off-by: Michael Zhou <joei4cm@gmail.com>
This commit is contained in:
@@ -100,11 +100,6 @@ function createDatabase(): Database.Database {
|
||||
CREATE TABLE bot_delegations (id TEXT PRIMARY KEY, requesting_bot_id TEXT, target_bot_id TEXT);
|
||||
CREATE TABLE bot_direct_message_threads (id TEXT PRIMARY KEY, bot_a_id TEXT, bot_b_id TEXT);
|
||||
CREATE TABLE bot_direct_messages (id TEXT PRIMARY KEY, sender_bot_id TEXT, recipient_bot_id TEXT);
|
||||
-- The real deletion transaction also clears deleted tasks' saved MCP views.
|
||||
CREATE TABLE mcp_app_view_states (
|
||||
message_id TEXT PRIMARY KEY, session_id TEXT NOT NULL, server_id TEXT NOT NULL,
|
||||
server_revision TEXT NOT NULL, plugin_instance TEXT, state_json TEXT NOT NULL, byte_length INTEGER NOT NULL
|
||||
);
|
||||
INSERT INTO bot_profiles (
|
||||
id, display_name, description, avatar, avatar_color, status,
|
||||
current_version, canonical_session_id, created_at, updated_at
|
||||
|
||||
Reference in New Issue
Block a user