Skip to content

Commit e50675f

Browse files
committed
fix: InsertOrUpdateBlobUpload
1 parent c68a4a0 commit e50675f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rollup/internal/orm/blob_upload.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ func (o *BlobUpload) InsertOrUpdateBlobUpload(ctx context.Context, batchIndex ui
115115
return fmt.Errorf("BlobUpload.InsertOrUpdateBlobUpload query error: %w, batch index: %v, batch_hash: %v, platform: %v", err, batchIndex, batchHash, platform)
116116
}
117117

118-
if err := db.Model(&existing).Update("status", int16(status)).Error; err != nil {
118+
if err := db.Model(&existing).Where("batch_index = ? AND batch_hash = ? AND platform = ? AND deleted_at IS NULL",
119+
batchIndex, batchHash, int16(platform)).Update("status", int16(status)).Error; err != nil {
119120
return fmt.Errorf("BlobUpload.InsertOrUpdateBlobUpload update error: %w, batch index: %v, batch_hash: %v, platform: %v", err, batchIndex, batchHash, platform)
120121
}
121122

0 commit comments

Comments
 (0)