From d9cff24c752e7ba0eb9387cf7a4f69d6907a5d13 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Wed, 3 Mar 2021 14:10:08 +0800 Subject: [PATCH] Modify: disable association_autoupdate in model.File.UpdateSourceName --- models/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/file.go b/models/file.go index bc2f011..7b1d6e8 100644 --- a/models/file.go +++ b/models/file.go @@ -196,7 +196,7 @@ func (file *File) UpdateSize(value uint64) error { // UpdateSourceName 更新文件的源文件名 func (file *File) UpdateSourceName(value string) error { - return DB.Model(&file).Update("source_name", value).Error + return DB.Model(&file).Set("gorm:association_autoupdate", false).Update("source_name", value).Error } /*