perf: add indexed notification summaries and widget
This commit is contained in:
@@ -19,6 +19,14 @@ class NotificationMessage(Base, TimestampMixin):
|
||||
__table_args__ = (
|
||||
Index("ix_notification_messages_tenant_status", "tenant_id", "status"),
|
||||
Index("ix_notification_messages_tenant_recipient", "tenant_id", "recipient_type", "recipient_id"),
|
||||
Index(
|
||||
"ix_notification_messages_summary",
|
||||
"tenant_id",
|
||||
"recipient_id",
|
||||
"deleted_at",
|
||||
"status",
|
||||
"read_at",
|
||||
),
|
||||
Index("ix_notification_messages_source", "tenant_id", "source_module", "source_resource_type", "source_resource_id"),
|
||||
Index("ix_notification_messages_due", "tenant_id", "status", "not_before_at"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user