from sqlalchemy import ( Integer, String, ForeignKey, PrimaryKeyConstraint, ForeignKeyConstraint, UniqueConstraint, ) from sqlalchemy.orm import Mapped, mapped_column from core.database import Base class Seal(Base): __tablename__ = "seal" __table_args__ = ( PrimaryKeyConstraint("id", name="seal_pkey"), ForeignKeyConstraint(["tenant_id"], ["a76.tenants.id"], name="fk_seal_tenant"), ForeignKeyConstraint( ["company_id"], ["a76.company.id"], name="fk_seal_company" ), UniqueConstraint("tenant_id", "company_id", "seal", name="seal_ukey"), {"schema": "a76"}, ) id: Mapped[int] = mapped_column(Integer, primary_key=True) tenant_id: Mapped[int] = mapped_column(Integer, nullable=False, index=True) company_id: Mapped[int] = mapped_column(Integer, nullable=False, index=True) seal: Mapped[str] = mapped_column(String(15))