From 24ae947516c85937270ada726c978969bca96ab4 Mon Sep 17 00:00:00 2001 From: michael <457813723@qq.com> Date: Mon, 13 Nov 2023 20:09:06 +0800 Subject: [PATCH] update pk when insert conflict --- dao/dao_account_info.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dao/dao_account_info.go b/dao/dao_account_info.go index 484a83c..2a5d5fe 100644 --- a/dao/dao_account_info.go +++ b/dao/dao_account_info.go @@ -181,7 +181,9 @@ func (d *DbDao) ConfirmProposal(incomeCellInfos []TableIncomeCellInfo, accountIn if len(cidPks) > 0 { if err := tx.Clauses(clause.OnConflict{ - DoUpdates: clause.AssignmentColumns([]string{}), + DoUpdates: clause.AssignmentColumns([]string{ + "pk", + }), }).Create(&cidPks).Error; err != nil { return err }