gitea/models
zeripath f3fb3c6f56
Open transaction when adding Avatar email-hash pairs to the DB ()
When adding Avatar email-hash pairs we simply want the DB table to
represent a Set. We don't care if the hash-pair is already present,
so we just simply Insert and ignore the error.

Unfortunately this seems to cause some DBs to log the duplicate
insert to their logs - looking like a bug a in Gitea.

Now, there is no standard way in SQL to say Insert but if there's
an error ignore it. MySQL has INSERT IGNORE, PostgreSQL >= 9.5 has
INSERT ... ON CONFLICT DO NOTHING, but I do not believe that SQLite
or MSSQL have variants.

This PR places the insert in a transaction which we are happy to fail
if there is an error - hopefully this will stop the unnecessary
logging.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
..
fixtures Kanban board ()
migrations Fix bug on migration 147 ()
access.go Upgrade xorm to v1.0.0 ()
access_test.go Fix "access" fixtures and tests ()
action.go Make dashboard newsfeed list length a configurable item ()
action_list.go
action_test.go Add gitea-vet ()
admin.go Add a storage layer for attachments ()
admin_test.go
attachment.go Add a storage layer for attachments ()
attachment_test.go Reading pull attachments should depend on read UnitTypePullRequests ()
avatar.go Open transaction when adding Avatar email-hash pairs to the DB ()
branches.go Default empty merger list to those with write permissions ()
branches_test.go
commit_status.go API add/generalize pagination ()
commit_status_test.go Fix wrong hint when status checking is running on pull request view ()
consistency.go Add migration to set IsArchived false if it is null ()
context.go Upgrade xorm to v1.0.2 ()
convert.go
error.go Kanban board ()
error_oauth2.go
external_login_user.go Migrate reviews when migrating repository from github ()
fixture_generation.go Move fixture generation to contrib and add test ()
fixture_test.go Move fixture generation to contrib and add test ()
gpg_key.go Allow addition of gpg keyring with multiple keys ()
gpg_key_test.go Allow addition of gpg keyring with multiple keys ()
helper.go
helper_directory.go Re-attempt to delete temporary upload if the file is locked by another process ()
helper_environment.go Move PushUpdateAddDeleteTags to repository module from models ()
issue.go Add a storage layer for attachments ()
issue_assignees.go Remove Unused Functions ()
issue_assignees_test.go
issue_comment.go Kanban board ()
issue_comment_list.go Fixed repo link in generated comment for cross repository dependency ()
issue_comment_test.go
issue_dependency.go
issue_dependency_test.go Refactor comment ()
issue_label.go Use ID or Where to instead directly use Get when load object from database ()
issue_label_test.go BugFix: updateLabel can updated not allowed fields ()
issue_list.go [BugFix] ReviewCount: GetApprovalCounts func sorted wrong ()
issue_list_test.go Add Organization Wide Labels ()
issue_lock.go remove unused method and rename createcommentWithNoAction ()
issue_milestone.go Kanban board ()
issue_milestone_test.go Add name filter to API for GetMilestoneList ()
issue_reaction.go API add/generalize pagination ()
issue_reaction_test.go Migrate reactions when migrating repository from github ()
issue_stopwatch.go When starting new stopwatch stop previous if it is still running ()
issue_stopwatch_test.go Add gitea-vet ()
issue_test.go issue search on my related repositories ()
issue_tracked_time.go Fix tracked time issues ()
issue_tracked_time_test.go [API] Extend times API ()
issue_user.go
issue_user_test.go Add "Update Branch" button to Pull Requests ()
issue_watch.go Add issue subscription check to API ()
issue_watch_test.go API add/generalize pagination ()
issue_xref.go remove unused method and rename createcommentWithNoAction ()
issue_xref_test.go Refactor comment ()
lfs.go Add gitea-vet ()
lfs_lock.go Make repository management section handle lfs locks ()
list_options.go Add cron running API ()
log.go Upgrade xorm to v1.0.0 ()
login_source.go Use ID or Where to instead directly use Get when load object from database ()
main_test.go Add gitea-vet ()
migrate.go [BugFix] remove nil inserts in models ()
models.go Kanban board ()
models_test.go
notification.go Extend Notifications API and return pinned notifications by default ()
notification_test.go add request review from specific reviewers feature in pull request ()
oauth2.go Changed image of openid-connect logo for better look on arc-green theme ()
oauth2_application.go Use google/uuid to instead satori/go.uuid ()
oauth2_application_test.go
org.go Fix bug preventing transfer to private organization ()
org_team.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team ()
org_team_test.go API add/generalize pagination ()
org_test.go Ensure DeleteUser is not allowed to Delete Orgs and visa versa ()
project.go Kanban board ()
project_board.go Kanban board ()
project_issue.go Kanban board ()
project_test.go Kanban board ()
pull.go Cache PullRequest Divergence ()
pull_list.go API add/generalize pagination ()
pull_sign.go models: break out of loop ()
pull_test.go Display pull request head branch even the branch deleted or repository deleted ()
release.go Add email notify for new release ()
repo.go OpenGraph: use repo avatar if exist ()
repo_activity.go Add top author stats to activity page ()
repo_branch.go Move newbranch to standalone package ()
repo_collaboration.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team ()
repo_collaboration_test.go API add/generalize pagination ()
repo_generate.go API add/generalize pagination ()
repo_generate_test.go Variable expansion in repository templates ()
repo_indexer.go Index code and stats only for non-empty repositories ()
repo_issue.go
repo_language_stats.go Increase size of the language column in language_stat ()
repo_list.go Fix repo-list private and total count bugs ()
repo_list_test.go API add/generalize pagination ()
repo_mirror.go Move some repository methods from models to modules/repository ()
repo_permission.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team ()
repo_permission_test.go
repo_redirect.go Move repoWorkPool outside rename/transfer repository ()
repo_redirect_test.go Move repoWorkPool outside rename/transfer repository ()
repo_sign.go models: break out of loops ()
repo_test.go Decrease the num_stars when deleting a repo ()
repo_unit.go Kanban board ()
repo_watch.go Add action feed for new release ()
repo_watch_test.go API add/generalize pagination ()
review.go Update Octicons to v10 ()
review_test.go Update Octicons to v10 ()
ssh_key.go Re-attempt to delete temporary upload if the file is locked by another process ()
ssh_key_test.go
star.go API add/generalize pagination ()
star_test.go API add/generalize pagination ()
task.go Move create/fork repository from models to modules/repository ()
test_fixtures.go upgrade to use testfixtures v3 ()
token.go Use google/uuid to instead satori/go.uuid ()
token_test.go Reject duplicate AccessToken names ()
topic.go Update topics repo count when deleting repository ()
topic_test.go API add/generalize pagination ()
twofactor.go Use ID or Where to instead directly use Get when load object from database ()
u2f.go
u2f_test.go Add gitea-vet ()
unit.go Kanban board ()
unit_tests.go Add a storage layer for attachments ()
update.go Remove Unused Functions ()
upload.go Re-attempt to delete temporary upload if the file is locked by another process ()
user.go Fix bug preventing transfer to private organization ()
user_follow.go
user_follow_test.go Add gitea-vet ()
user_heatmap.go Add hide activity option ()
user_heatmap_test.go Restricted users ()
user_mail.go Use ID or Where to instead directly use Get when load object from database ()
user_mail_test.go Admin page for managing user e-mail activation ()
user_openid.go Use ID or Where to instead directly use Get when load object from database ()
user_openid_test.go
user_test.go Ensure DeleteUser is not allowed to Delete Orgs and visa versa ()
userlist.go API add/generalize pagination ()
userlist_test.go Team permission to create repository in organization ()
webhook.go Use google/uuid to instead satori/go.uuid ()
webhook_test.go Granular webhook events ()
wiki.go Add owner_name column for table repository for maintaince reason ()
wiki_test.go Move wiki related funtions from models to services/wiki ()