feat: 静态通知同步 + 积分审计 JSONB 序列化修复

This commit is contained in:
qzl
2026-04-10 19:23:38 +08:00
parent 1cdaeb274e
commit 4b258bb4d0
13 changed files with 1196 additions and 14 deletions
+13
View File
@@ -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(