From eaa0b37d14b86e274b87facfbd586ee92fcad077 Mon Sep 17 00:00:00 2001 From: DmsAnhr Date: Mon, 22 Dec 2025 15:18:43 +0700 Subject: [PATCH] update models --- database/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/database/models.py b/database/models.py index fa7c787..27b297d 100644 --- a/database/models.py +++ b/database/models.py @@ -17,14 +17,14 @@ class UploadLog(Base): message = Column(Text) -class Institution(Base): - __tablename__ = "institutions" +class Organization(Base): + __tablename__ = "organizations" id = Column(Integer, primary_key=True, index=True) name = Column(String(100), unique=True, nullable=False) address = Column(String(200), nullable=True) - users = relationship("User", back_populates="institution") + users = relationship("User", back_populates="organization") class User(Base): @@ -34,9 +34,9 @@ class User(Base): username = Column(String(50), unique=True, nullable=False) password_hash = Column(String(255), nullable=False) role = Column(String(50), nullable=False, default="user") # <── Added role - institution_id = Column(Integer, ForeignKey("institutions.id"), nullable=True) + organization_id = Column(Integer, ForeignKey("organizations.id"), nullable=True) active_token = Column(String(255), nullable=True) token_expired_at = Column(DateTime, nullable=True) last_login = Column(DateTime, nullable=True) - institution = relationship("Institution", back_populates="users") \ No newline at end of file + organization = relationship("Organization", back_populates="users") \ No newline at end of file