refac: migration

This commit is contained in:
Timothy Jaeryang Baek 2024-11-16 14:56:00 -08:00
parent 243e187f0b
commit 345c9d12a9
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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),