from datetime import datetime from typing import Optional from sqlalchemy import BigInteger, Boolean, DateTime, String, func from sqlalchemy.orm import Mapped, mapped_column from app.db.base import Base class BotGroup(Base): """A class/department group the bot was added to (every member of it can see the bot).""" __tablename__ = "bot_groups" chat_id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=False) title: Mapped[Optional[str]] = mapped_column(String(128)) active: Mapped[bool] = mapped_column(Boolean, default=True) added_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())