fix problem with closing subwindows and define field length for id in schema
This commit is contained in:
@@ -35,7 +35,7 @@ class Token(Base, BaseMixin):
|
||||
name = Column(String(255))
|
||||
last_used_date: Mapped[datetime] = mapped_column()
|
||||
enabled = Column(BIT(1))
|
||||
user_id = Column(String, ForeignKey("user.id"), nullable=False)
|
||||
user_id = Column(String(255), ForeignKey("user.id"), nullable=False)
|
||||
user = relationship("User", back_populates="tokens")
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ class Base(DeclarativeBase):
|
||||
|
||||
|
||||
class BaseMixin:
|
||||
# id = Column(String, primary_key=True)
|
||||
id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4())
|
||||
id = Column(String(255), primary_key=True, default=uuid.uuid4())
|
||||
# id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4())
|
||||
# created_date = Column(DateTime)
|
||||
created_date: Mapped[datetime] = mapped_column(default=func.now())
|
||||
# last_modified_date = Column(DateTime)
|
||||
|
||||
Reference in New Issue
Block a user