Skip to content

Commit 17e30e3

Browse files
author
yangyi
committed
refactor: 代码改进
1 parent 2ae5323 commit 17e30e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func doUpsert(ctx context.Context, ent Entity, db DB) error {
186186
return fmt.Errorf("get metadata, %w", err)
187187
}
188188

189-
for _, col := range md.Columns {
189+
for _, col := range md.PrimaryKeys {
190190
if col.AutoIncrement {
191191
return fmt.Errorf("upsert not support auto increment primary key %q", col.DBField)
192192
}

0 commit comments

Comments
 (0)