修复cookie失效后的一些问题
This commit is contained in:
@@ -24,7 +24,7 @@ class Account(Base):
|
||||
|
||||
user = relationship("User", back_populates="accounts")
|
||||
tasks = relationship("Task", back_populates="account", cascade="all, delete-orphan")
|
||||
signin_logs = relationship("SigninLog", back_populates="account")
|
||||
signin_logs = relationship("SigninLog", back_populates="account", cascade="all, delete-orphan", passive_deletes=True)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Account(id={self.id}, weibo_user_id='{self.weibo_user_id}')>"
|
||||
|
||||
@@ -10,7 +10,7 @@ from .base import Base
|
||||
class SigninLog(Base):
|
||||
__tablename__ = "signin_logs"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
account_id = Column(String(36), ForeignKey("accounts.id"), nullable=False)
|
||||
account_id = Column(String(36), ForeignKey("accounts.id", ondelete="CASCADE"), nullable=False)
|
||||
topic_title = Column(String(100))
|
||||
status = Column(String(50), nullable=False)
|
||||
reward_info = Column(JSON, nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user