from pydantic import BaseModel from sqlalchemy import Column, JSON from sqlmodel import Field, SQLModel from app.models.common import AESEncryptedColumn, DeploymentType class ConfluenceSiteConfig(BaseModel): pass class ConfluenceSite(SQLModel, table=True): __tablename__ = "confluence_sites" id: int = Field(primary_key=True) deployment_type: DeploymentType = Field(nullable=False) host: str = Field(nullable=False, max_length=128) name: str = Field(nullable=False, max_length=32) bot_user_id: str = Field(nullable=False, description="user email") bot_user_token: str = Field(sa_column=Column(AESEncryptedColumn, nullable=False)) config: ConfluenceSiteConfig = Field(default={}, sa_column=Column(JSON))