from sqlalchemy import Column, BigInteger, Integer, String, ForeignKey from app.core.database import Base class SectionSchedule(Base): __tablename__ = "section_schedules" id = Column(BigInteger, primary_key=True, autoincrement=True) section_id = Column(BigInteger, ForeignKey("sections.id", ondelete="CASCADE"), nullable=False) account_id = Column(BigInteger, ForeignKey("accounts.id"), nullable=False) day_of_week = Column(Integer, nullable=False) entry_time = Column(String(5), nullable=False) exit_time = Column(String(5), nullable=False) subject_id = Column(BigInteger, ForeignKey("subjects.id", ondelete="SET NULL"), nullable=True)