Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions astrbot/core/backup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from astrbot.core.db.po import (
Attachment,
ChatUIProject,
CommandConfig,
CommandConflict,
ConversationV2,
Expand All @@ -16,6 +17,7 @@
PlatformSession,
PlatformStat,
Preference,
SessionProjectRelation,
)
from astrbot.core.knowledge_base.models import (
KBDocument,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion tests/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -1017,6 +1017,8 @@ def test_main_db_models_contain_expected_tables(self):
"conversations",
"personas",
"preferences",
"chatui_projects",
"session_project_relations",
Comment on lines +1020 to +1021
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding chatui_projects and session_project_relations is correct, the expected_tables list is still missing several other tables that are currently defined in MAIN_DB_MODELS (specifically persona_folders, platform_message_history, platform_sessions, command_configs, and command_conflicts). To ensure the test provides full coverage and correctly tracks all models included in the backup process, it is recommended to include all keys from MAIN_DB_MODELS in this list.

            "persona_folders",
            "platform_message_history",
            "platform_sessions",
            "chatui_projects",
            "session_project_relations",
            "command_configs",
            "command_conflicts",

"attachments",
]
for table in expected_tables:
Expand Down
Loading