From 4940225c1f9133af6a6c7e1dd234a6a563fbdfdd Mon Sep 17 00:00:00 2001 From: RC-CHN <1051989940@qq.com> Date: Wed, 8 Apr 2026 11:30:57 +0800 Subject: [PATCH] fix: add ChatUIProject & SessionProjectRelation to shared constants & test cases --- astrbot/core/backup/constants.py | 4 ++++ tests/test_backup.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/astrbot/core/backup/constants.py b/astrbot/core/backup/constants.py index be206b3074..b832a1b72a 100644 --- a/astrbot/core/backup/constants.py +++ b/astrbot/core/backup/constants.py @@ -7,6 +7,7 @@ from astrbot.core.db.po import ( Attachment, + ChatUIProject, CommandConfig, CommandConflict, ConversationV2, @@ -16,6 +17,7 @@ PlatformSession, PlatformStat, Preference, + SessionProjectRelation, ) from astrbot.core.knowledge_base.models import ( KBDocument, @@ -44,6 +46,8 @@ "preferences": Preference, "platform_message_history": PlatformMessageHistory, "platform_sessions": PlatformSession, + "chatui_projects": ChatUIProject, + "session_project_relations": SessionProjectRelation, "attachments": Attachment, "command_configs": CommandConfig, "command_conflicts": CommandConflict, diff --git a/tests/test_backup.py b/tests/test_backup.py index cf3c4d9494..b36e9b0c33 100644 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -17,9 +17,9 @@ ) from astrbot.core.backup.exporter import AstrBotExporter from astrbot.core.backup.importer import ( - DatabaseClearError, PLATFORM_STATS_INVALID_COUNT_WARN_LIMIT, AstrBotImporter, + DatabaseClearError, ImportResult, _get_major_version, ) @@ -1017,6 +1017,8 @@ def test_main_db_models_contain_expected_tables(self): "conversations", "personas", "preferences", + "chatui_projects", + "session_project_relations", "attachments", ] for table in expected_tables: