合入持久化刷卡语音消息的代码,暂未测试
This commit is contained in:
@@ -365,6 +365,34 @@ class IMMessage(Base):
|
||||
deleted_at: Mapped[Optional[datetime]] = mapped_column(DateTime)
|
||||
|
||||
|
||||
class DevicePendingVoiceMessage(Base):
|
||||
__tablename__ = "device_pending_voice_messages"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("target_device_id", "im_message_id", name="uq_device_pending_voice_target_msg"),
|
||||
Index("idx_device_pending_voice_target_status_created", "target_device_id", "status", "created_at"),
|
||||
Index("idx_device_pending_voice_sender", "sender_device_id"),
|
||||
Index("idx_device_pending_voice_im_message", "im_message_id"),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
target_device_id: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
sender_device_id: Mapped[Optional[str]] = mapped_column(String(64))
|
||||
im_message_id: Mapped[int] = mapped_column(BigInteger, nullable=False)
|
||||
media_file_key: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
audio_url: Mapped[Optional[str]] = mapped_column(String(512))
|
||||
source: Mapped[str] = mapped_column(String(32), nullable=False, server_default=text("'unknown'"))
|
||||
status: Mapped[str] = mapped_column(String(32), nullable=False, server_default=text("'pending'"))
|
||||
delivery_count: Mapped[int] = mapped_column(Integer, nullable=False, server_default=text("0"))
|
||||
delivered_at: Mapped[Optional[datetime]] = mapped_column(DateTime)
|
||||
listened_at: Mapped[Optional[datetime]] = mapped_column(DateTime)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=text("CURRENT_TIMESTAMP"))
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime,
|
||||
server_default=text("CURRENT_TIMESTAMP"),
|
||||
onupdate=datetime.utcnow,
|
||||
)
|
||||
|
||||
|
||||
class ChildLocationCurrent(Base):
|
||||
__tablename__ = "child_location_current"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user