From 0837090fa94cd447e68c2f8ade30a3827d2c9f89 Mon Sep 17 00:00:00 2001 From: CaIon Date: Sat, 7 Feb 2026 23:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20refactor:=20Enhance=20Log=20stru?= =?UTF-8?q?ct=20indexing=20for=20improved=20query=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/log.go b/model/log.go index 11024b9ef..d7cd97a42 100644 --- a/model/log.go +++ b/model/log.go @@ -17,8 +17,8 @@ import ( ) type Log struct { - Id int `json:"id" gorm:"index:idx_created_at_id,priority:1"` - UserId int `json:"user_id" gorm:"index"` + Id int `json:"id" gorm:"index:idx_created_at_id,priority:1;index:idx_user_id_id,priority:2"` + UserId int `json:"user_id" gorm:"index;index:idx_user_id_id,priority:1"` CreatedAt int64 `json:"created_at" gorm:"bigint;index:idx_created_at_id,priority:2;index:idx_created_at_type"` Type int `json:"type" gorm:"index:idx_created_at_type"` Content string `json:"content"`