File size: 574 Bytes
b37ebd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from typing import Optional

from sqlalchemy import Integer, String
from sqlalchemy.orm import Mapped, mapped_column

from app.db.base import Base


class Course(Base):
    __tablename__ = "courses"

    id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
    code: Mapped[Optional[str]] = mapped_column(String(32))
    name: Mapped[str] = mapped_column(String(256))
    stream: Mapped[Optional[str]] = mapped_column(String(16))
    year: Mapped[Optional[int]] = mapped_column(Integer)
    semester: Mapped[Optional[int]] = mapped_column(Integer)