From a6360ac3e0fa26063b299f1a2f6c49cac4f2ac2d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 22 Jul 2025 16:05:14 +0800 Subject: [PATCH] perf: Assistant description --- .../versions/032_modify_assistant_ddl.py | 25 +++++++++++++++++++ backend/apps/system/models/system_model.py | 1 + backend/apps/system/schemas/system_schema.py | 1 + 3 files changed, 27 insertions(+) create mode 100644 backend/alembic/versions/032_modify_assistant_ddl.py diff --git a/backend/alembic/versions/032_modify_assistant_ddl.py b/backend/alembic/versions/032_modify_assistant_ddl.py new file mode 100644 index 00000000..b1f09b75 --- /dev/null +++ b/backend/alembic/versions/032_modify_assistant_ddl.py @@ -0,0 +1,25 @@ +"""032_modify_assistant_ddl + +Revision ID: 6549e47f9adc +Revises: bd2ed188b5bd +Create Date: 2025-07-22 12:23:16.646665 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '6549e47f9adc' +down_revision = 'bd2ed188b5bd' +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column('sys_assistant', sa.Column('description', sa.Text(), nullable=True)) + + +def downgrade(): + op.drop_column('sys_assistant', 'description') diff --git a/backend/apps/system/models/system_model.py b/backend/apps/system/models/system_model.py index ad344781..5e73d12e 100644 --- a/backend/apps/system/models/system_model.py +++ b/backend/apps/system/models/system_model.py @@ -47,6 +47,7 @@ class AssistantBaseModel(SQLModel): name: str = Field(max_length=255, nullable=False) type: int = Field(nullable=False, default=0) domain: str = Field(max_length=255, nullable=False) + description: str = Field(sa_type = Text(), nullable=True) configuration: Optional[str] = Field(sa_type = Text(), nullable=True) create_time: int = Field(default=0, sa_type=BigInteger()) diff --git a/backend/apps/system/schemas/system_schema.py b/backend/apps/system/schemas/system_schema.py index 28e30505..3d2ab410 100644 --- a/backend/apps/system/schemas/system_schema.py +++ b/backend/apps/system/schemas/system_schema.py @@ -68,6 +68,7 @@ class AssistantBase(BaseModel): domain: str type: int = 0 configuration: Optional[str] = None + description: Optional[str] = None class AssistantDTO(AssistantBase, BaseCreatorDTO): pass