refactor: 完成数据库重构 - 批量更新导入路径
- 更新35个文件的导入路径 (共65处修改) - sqlalchemy_models core.models (模型类) - sqlalchemy_database_api compatibility (兼容函数) - database.database core (初始化/关闭函数) - 添加自动化导入更新工具 (scripts/update_database_imports.py) - 所有兼容性层测试通过 (26/26) - 数据库核心功能测试通过 (18/21)
This commit is contained in:
@@ -263,7 +263,7 @@ class AntiPromptInjector:
|
||||
try:
|
||||
from sqlalchemy import delete
|
||||
|
||||
from src.common.database.sqlalchemy_models import Messages, get_db_session
|
||||
from src.common.database.core.models import Messages, get_db_session
|
||||
|
||||
message_id = message_data.get("message_id")
|
||||
if not message_id:
|
||||
@@ -290,7 +290,7 @@ class AntiPromptInjector:
|
||||
try:
|
||||
from sqlalchemy import update
|
||||
|
||||
from src.common.database.sqlalchemy_models import Messages, get_db_session
|
||||
from src.common.database.core.models import Messages, get_db_session
|
||||
|
||||
message_id = message_data.get("message_id")
|
||||
if not message_id:
|
||||
|
||||
@@ -9,7 +9,7 @@ from typing import Any, TypeVar, cast
|
||||
|
||||
from sqlalchemy import delete, select
|
||||
|
||||
from src.common.database.sqlalchemy_models import AntiInjectionStats, get_db_session
|
||||
from src.common.database.core.models import AntiInjectionStats, get_db_session
|
||||
from src.common.logger import get_logger
|
||||
from src.config.config import global_config
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import datetime
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
from src.common.database.sqlalchemy_models import BanUser, get_db_session
|
||||
from src.common.database.core.models import BanUser, get_db_session
|
||||
from src.common.logger import get_logger
|
||||
|
||||
from ..types import DetectionResult
|
||||
|
||||
Reference in New Issue
Block a user