File size: 672 Bytes
6aa6081
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)