Skip to content

Commit

Permalink
fix: ignore episode record exists
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 10, 2024
1 parent cf9d301 commit 2d534b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/collections/infra/mysql_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,8 @@ func (r mysqlRepo) createEpisodeCollection(
}

table := r.q.EpCollection
err = table.WithContext(ctx).Where(table.UserID.Eq(userID), table.SubjectID.Eq(subjectID)).Create(&dao.EpCollection{
err = table.WithContext(ctx).Clauses(clause.OnConflict{DoNothing: true}).
Where(table.UserID.Eq(userID), table.SubjectID.Eq(subjectID)).Create(&dao.EpCollection{
UserID: userID,
SubjectID: subjectID,
Status: bytes,
Expand Down

0 comments on commit 2d534b5

Please sign in to comment.