feat(weibo): 拆分账号管理与个人工作台
This commit is contained in:
@@ -961,6 +961,31 @@ class WeiboAccount(Base):
|
||||
)
|
||||
|
||||
|
||||
class WeiboWorkbenchAccount(Base):
|
||||
"""用户个人微博工作台中的账号选择。"""
|
||||
|
||||
__tablename__ = "weibo_workbench_accounts"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True
|
||||
)
|
||||
account_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("weibo_accounts.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
created_at: Mapped[datetime] = mapped_column(UTCDateTime, default=_utcnow)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"user_id",
|
||||
"account_id",
|
||||
name="uq_weibo_workbench_account",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class WeiboCollabShop(Base):
|
||||
"""微博外部单协作的店铺字典。"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user