from sqlalchemy import Column, BigInteger, ForeignKey, PrimaryKeyConstraint from app.core.database import Base class SectionSubject(Base): __tablename__ = "section_subjects" section_id = Column(BigInteger, ForeignKey("sections.id", ondelete="CASCADE"), nullable=False) subject_id = Column(BigInteger, ForeignKey("subjects.id", ondelete="CASCADE"), nullable=False) account_id = Column(BigInteger, ForeignKey("accounts.id"), nullable=False) __table_args__ = ( PrimaryKeyConstraint("section_id", "subject_id"), )