From 5748f6ef77fb0a0a34b8f11c503673eade7f2c26 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 22 Dec 2024 22:08:27 -0700 Subject: [PATCH] refac --- .../migrations/versions/57c599a3cb57_add_channel_table.py | 2 +- backend/open_webui/models/channels.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/migrations/versions/57c599a3cb57_add_channel_table.py b/backend/open_webui/migrations/versions/57c599a3cb57_add_channel_table.py index 135dfe002..54176dc46 100644 --- a/backend/open_webui/migrations/versions/57c599a3cb57_add_channel_table.py +++ b/backend/open_webui/migrations/versions/57c599a3cb57_add_channel_table.py @@ -21,7 +21,7 @@ def upgrade(): sa.Column("id", sa.Text(), nullable=False, primary_key=True, unique=True), sa.Column("user_id", sa.Text()), sa.Column("name", sa.Text()), - sa.Column("description", sa.Text()), + sa.Column("description", sa.Text(), nullable=True), sa.Column("data", sa.JSON(), nullable=True), sa.Column("meta", sa.JSON(), nullable=True), sa.Column("access_control", sa.JSON(), nullable=True), diff --git a/backend/open_webui/models/channels.py b/backend/open_webui/models/channels.py index cc49953e7..43f01e2f3 100644 --- a/backend/open_webui/models/channels.py +++ b/backend/open_webui/models/channels.py @@ -23,6 +23,8 @@ class Channel(Base): user_id = Column(Text) name = Column(Text) + description = Column(Text, nullable=True) + data = Column(JSON, nullable=True) meta = Column(JSON, nullable=True) access_control = Column(JSON, nullable=True) @@ -36,6 +38,7 @@ class ChannelModel(BaseModel): id: str user_id: str + description: Optional[str] = None name: str data: Optional[dict] = None @@ -53,6 +56,7 @@ class ChannelModel(BaseModel): class ChannelForm(BaseModel): name: str + description: Optional[str] = None data: Optional[dict] = None meta: Optional[dict] = None access_control: Optional[dict] = None