update backend
This commit is contained in:
@ -13,7 +13,7 @@ class SqlAlchemyBase(Model):
|
||||
__abstract__ = True
|
||||
|
||||
created_at: Mapped[datetime | None] = mapped_column(DateTime, default=datetime.utcnow(), index=True)
|
||||
update_at: Mapped[datetime | None] = mapped_column(DateTime, default=datetime.utcnow(), onupdate=datetime.utcnow())
|
||||
updated_at: Mapped[datetime | None] = mapped_column(DateTime, default=datetime.utcnow(), onupdate=datetime.utcnow())
|
||||
|
||||
@classmethod
|
||||
def normalize(cls, val: str) -> str:
|
||||
|
@ -25,7 +25,7 @@ class SessionLogin(SqlAlchemyBase):
|
||||
__tablename__ = 'session_login'
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
||||
session: Mapped[str] = mapped_column(UUID, default=uuid4, index=True, nullable=False)
|
||||
session: Mapped[str] = mapped_column(String, unique=True, index=True, nullable=False)
|
||||
user_id: Mapped[str] = mapped_column(ForeignKey("users.id"), unique=True, index=True, nullable=False)
|
||||
|
||||
user = relationship("User", back_populates="session_login")
|
||||
|
Reference in New Issue
Block a user