From f18465bba3890f8a415ee63287330ab728b159d9 Mon Sep 17 00:00:00 2001 From: nyne Date: Thu, 26 Jun 2025 19:52:49 +0800 Subject: [PATCH] Add composite index on Activity Type and RefID fields --- server/model/activity.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/model/activity.go b/server/model/activity.go index 4b1c50b..1777b9d 100644 --- a/server/model/activity.go +++ b/server/model/activity.go @@ -17,8 +17,8 @@ const ( type Activity struct { gorm.Model UserID uint `gorm:"not null"` - Type ActivityType `gorm:"not null"` - RefID uint `gorm:"not null"` // Reference ID for the resource or comment + Type ActivityType `gorm:"not null;index:idx_type_refid"` + RefID uint `gorm:"not null;index:idx_type_refid"` } type ActivityView struct {