feat: 静态通知同步 + 积分审计 JSONB 序列化修复
This commit is contained in:
@@ -31,6 +31,13 @@ class Notification(TimestampMixin, SoftDeleteMixin, Base):
|
||||
"ix_notifications_published_at",
|
||||
"published_at",
|
||||
),
|
||||
Index(
|
||||
"uq_notifications_source_source_key",
|
||||
"source",
|
||||
"source_key",
|
||||
unique=True,
|
||||
postgresql_where=text("source_key IS NOT NULL"),
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
@@ -39,6 +46,12 @@ class Notification(TimestampMixin, SoftDeleteMixin, Base):
|
||||
type: Mapped[str] = mapped_column(
|
||||
String(32), nullable=False, server_default=text("'system'")
|
||||
)
|
||||
source: Mapped[str] = mapped_column(
|
||||
String(32), nullable=False, server_default=text("'manual'")
|
||||
)
|
||||
source_key: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
source_version: Mapped[int | None] = mapped_column(nullable=True)
|
||||
content_hash: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
||||
title: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
body: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
payload: Mapped[dict[str, object]] = mapped_column(
|
||||
|
||||
Reference in New Issue
Block a user