Skip to content

Conversation

@komarov
Copy link

@komarov komarov commented Mar 20, 2025

Fixes #33949

RemoveUserBadges implementation is fixed to avoid an ORM construct that produced invalid SQL (see the referenced issue for details).

AddUserBadges won't be able to produce duplicate badges anymore due to a unique constraint added to the user_badge table. An attempt to add a duplicate badge will result in an error.
The corresponding database migration is supposed to delete any potential badge duplicates existing before.

A new test is added to demonstrate these fixes.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 20, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/migrations labels Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code modifies/migrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User badges model: RemoveUserBadges is broken and AddUserBadges creates duplicates

3 participants