login passwd

This commit is contained in:
2026-04-25 19:54:39 +02:00
parent 8cd28873e8
commit 4e26248dc8
10 changed files with 277 additions and 6 deletions

View File

@@ -17,6 +17,19 @@ class Student(Base):
mastery = relationship("StudentSkillMastery", back_populates="student", cascade="all, delete-orphan")
class User(Base):
__tablename__ = "users"
id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True)
username: Mapped[str] = mapped_column(String(120), unique=True, index=True)
password_hash: Mapped[str] = mapped_column(String(255))
role: Mapped[str] = mapped_column(String(30), index=True)
student_id: Mapped[int | None] = mapped_column(ForeignKey("students.id"), nullable=True, index=True)
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
student = relationship("Student")
class Message(Base):
__tablename__ = "messages"