File size: 664 Bytes
6aa6081
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from sqlalchemy import Column, BigInteger, String, Integer, DateTime, ForeignKey
from sqlalchemy import func
from app.core.database import Base


class Section(Base):
    __tablename__ = "sections"

    id = Column(BigInteger, primary_key=True, autoincrement=True)
    account_id = Column(BigInteger, ForeignKey("accounts.id"), nullable=False)
    subject_id = Column(BigInteger, ForeignKey("subjects.id"), nullable=True)
    name = Column(String(150), nullable=False)
    level = Column(String(50))
    academic_period = Column(String(50))
    max_students = Column(Integer, default=40)
    created_at = Column(DateTime(timezone=True), server_default=func.now())