Skip to content

Commit

Permalink
[fix] 修复错误的create update判断
Browse files Browse the repository at this point in the history
  • Loading branch information
runs committed Jan 10, 2023
1 parent 64b90b2 commit 4c30e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/repository/bilbil_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (impl *BilibiliVideoMysqlImpl) Save(e *idl.BilibiliVideo) error {
}

// on create
if e.Id != 0 {
if e.Id == 0 {
result = _tx.Table(bilibiliVideoTableName).Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "bvid"}},
DoUpdates: clause.AssignmentColumns(strings.Split(onUpdateFields, ",")),
Expand Down

0 comments on commit 4c30e31

Please sign in to comment.