From 8a4d6f332778da1d6cf719db3ee46ff99f210954 Mon Sep 17 00:00:00 2001 From: Calcium-Ion <61247483+Calcium-Ion@users.noreply.github.com> Date: Sun, 14 Jan 2024 13:48:16 +0800 Subject: [PATCH] fix: remove useless wrong index (#916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add sqlite busy_timeout=3000 * chore: update impl * fix: fix JSON tag in Log struct * fix: 修复高并发下,高额度用户使用低额度令牌没有预扣费而导致令牌大额欠费 * Revert "fix: 修复高并发下,高额度用户使用低额度令牌没有预扣费而导致令牌大额欠费" This reverts commit f0ffe144371a4e118478306b906ddb7a5f027024. * fix: remove wrong index --------- Co-authored-by: JustSong --- model/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/log.go b/model/log.go index 307928c4..06085acf 100644 --- a/model/log.go +++ b/model/log.go @@ -9,9 +9,9 @@ import ( ) type Log struct { - Id int `json:"id;index:idx_created_at_id,priority:1"` + Id int `json:"id"` UserId int `json:"user_id" gorm:"index"` - CreatedAt int64 `json:"created_at" gorm:"bigint;index:idx_created_at_id,priority:2;index:idx_created_at_type"` + CreatedAt int64 `json:"created_at" gorm:"bigint;index:idx_created_at_type"` Type int `json:"type" gorm:"index:idx_created_at_type"` Content string `json:"content"` Username string `json:"username" gorm:"index:index_username_model_name,priority:2;default:''"`