From 76fcc56866733b3161f57b1c287fefbef00894f3 Mon Sep 17 00:00:00 2001 From: Ruochen Pan Date: Wed, 8 Apr 2026 11:35:59 +0800 Subject: [PATCH] fix: add ChatUIProject & SessionProjectRelation to shared constants & test cases (#7414) --- 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 be206b307..b832a1b72 100644 --- a/astrbot/core/backup/constants.py +++ b/astrbot/core/backup/constants.py @@ -7,6 +7,7 @@ from sqlmodel import SQLModel from astrbot.core.db.po import ( Attachment, + ChatUIProject, CommandConfig, CommandConflict, ConversationV2, @@ -16,6 +17,7 @@ from astrbot.core.db.po import ( PlatformSession, PlatformStat, Preference, + SessionProjectRelation, ) from astrbot.core.knowledge_base.models import ( KBDocument, @@ -44,6 +46,8 @@ MAIN_DB_MODELS: dict[str, type[SQLModel]] = { "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 cf3c4d949..b36e9b0c3 100644 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -17,9 +17,9 @@ from astrbot.core.backup import ( ) 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 @@ class TestModelMappings: "conversations", "personas", "preferences", + "chatui_projects", + "session_project_relations", "attachments", ] for table in expected_tables: