diff --git a/internal/postgres/tag.go b/internal/postgres/tag.go index e22426b..0270085 100644 --- a/internal/postgres/tag.go +++ b/internal/postgres/tag.go @@ -188,7 +188,10 @@ func CreateTagAlias(ctx context.Context, db *gorm.DB, tagAliasName models.Anthro 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), TagID: string(tagID), })