1.9
This commit is contained in:
@@ -21,12 +21,15 @@ class Message(Base):
|
||||
sender_id: Mapped[str] = mapped_column(
|
||||
String(36), ForeignKey("users.id", ondelete="CASCADE"), nullable=False
|
||||
)
|
||||
type: Mapped[str] = mapped_column(String(20), default="text") # text / image / file / system
|
||||
type: Mapped[str] = mapped_column(String(20), default="text") # text / image / file / voice / system
|
||||
content: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
reply_to_id: Mapped[str | None] = mapped_column(
|
||||
String(36), ForeignKey("messages.id", ondelete="SET NULL"), nullable=True
|
||||
)
|
||||
mentions: Mapped[str | None] = mapped_column(Text, nullable=True) # JSON: 被@的用户ID列表
|
||||
is_deleted: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
is_recalled: Mapped[bool] = mapped_column(Boolean, default=False) # 撤回
|
||||
recalled_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime, default=lambda: datetime.utcnow(), index=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user