feat: modify chat

This commit is contained in:
ulleo
2025-06-25 16:02:14 +08:00
parent 72b6e117c8
commit 7fa845019c
3 changed files with 35 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ script_location = alembic
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
file_template = %%(slug)s.py
file_template = %%(slug)s
# timezone to use when rendering the date
# within the migration file as well as the filename.
@@ -0,0 +1,33 @@
"""015_modify_chat
Revision ID: 02d84523a979
Revises: fde8acca6143
Create Date: 2025-06-25 15:45:14.968598
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '02d84523a979'
down_revision = 'fde8acca6143'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('chat', 'datasource',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('chat', 'datasource',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###
+1 -1
View File
@@ -18,7 +18,7 @@ class Chat(SQLModel, table=True):
create_by: int = Field(sa_column=Column(BigInteger, nullable=True))
brief: str = Field(max_length=64, nullable=True)
chat_type: str = Field(max_length=20, default="chat") # chat, datasource
datasource: int = Field(sa_column=Column(Integer, nullable=False))
datasource: int = Field(sa_column=Column(Integer, nullable=True))
engine_type: str = Field(max_length=64)