develop/batch-jobs #13
@ -188,7 +188,10 @@ func CreateTagAlias(ctx context.Context, db *gorm.DB, tagAliasName models.Anthro
|
|||||||
return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
return &otterError.EntityValidationFailed{Reason: otterError.AnthroveTagIDEmpty}
|
||||||
}
|
}
|
||||||
|
|
||||||
result := db.WithContext(ctx).Create(&models.TagAlias{
|
result := db.WithContext(ctx).Clauses(clause.OnConflict{
|
||||||
|
Columns: []clause.Column{{Name: "name"}},
|
||||||
|
DoNothing: true,
|
||||||
|
}).Create(&models.TagAlias{
|
||||||
Name: string(tagAliasName),
|
Name: string(tagAliasName),
|
||||||
TagID: string(tagID),
|
TagID: string(tagID),
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user