From 345c9d12a99fd81cb7d8bde885ff998de1ad0da1 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 16 Nov 2024 14:56:00 -0800 Subject: [PATCH] refac: migration --- backend/open_webui/apps/webui/models/groups.py | 5 +++++ .../migrations/versions/922e7a387820_add_group_table.py | 1 + 2 files changed, 6 insertions(+) diff --git a/backend/open_webui/apps/webui/models/groups.py b/backend/open_webui/apps/webui/models/groups.py index 89717e16b..e687374ea 100644 --- a/backend/open_webui/apps/webui/models/groups.py +++ b/backend/open_webui/apps/webui/models/groups.py @@ -30,6 +30,8 @@ class Group(Base): name = Column(Text) description = Column(Text) + + data = Column(JSON, nullable=True) meta = Column(JSON, nullable=True) permissions = Column(JSON, nullable=True) @@ -46,6 +48,8 @@ class GroupModel(BaseModel): name: str description: str + + data: Optional[dict] = None meta: Optional[dict] = None permissions: Optional[dict] = None @@ -66,6 +70,7 @@ class GroupResponse(BaseModel): name: str description: str permissions: Optional[dict] = None + data: Optional[dict] = None meta: Optional[dict] = None user_ids: list[str] = [] created_at: int # timestamp in epoch diff --git a/backend/open_webui/migrations/versions/922e7a387820_add_group_table.py b/backend/open_webui/migrations/versions/922e7a387820_add_group_table.py index bdab303a7..a75211584 100644 --- a/backend/open_webui/migrations/versions/922e7a387820_add_group_table.py +++ b/backend/open_webui/migrations/versions/922e7a387820_add_group_table.py @@ -22,6 +22,7 @@ def upgrade(): sa.Column("user_id", sa.Text(), nullable=True), sa.Column("name", sa.Text(), nullable=True), sa.Column("description", sa.Text(), nullable=True), + sa.Column("data", sa.JSON(), nullable=True), sa.Column("meta", sa.JSON(), nullable=True), sa.Column("permissions", sa.JSON(), nullable=True), sa.Column("user_ids", sa.JSON(), nullable=True),