diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-06-29 21:38:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 21:38:22 +0800 |
commit | 462284e2f5768cf04d71c7abd8c01eef20cff73d (patch) | |
tree | 10d970a11d6c604cbe99cbd1e89c6dda983d6ac7 /modules/migrations/base | |
parent | e463bdaf8d995d0b399c1848a780ac5aa8798f0d (diff) | |
download | gitea-462284e2f5768cf04d71c7abd8c01eef20cff73d.tar.gz gitea-462284e2f5768cf04d71c7abd8c01eef20cff73d.zip |
Use batch insert on migrating repository to make the process faster (#7050)
* Use batch insert on migrating repository to make the process faster
* fix lint
* fix tests
* fix comments
Diffstat (limited to 'modules/migrations/base')
-rw-r--r-- | modules/migrations/base/comment.go | 1 | ||||
-rw-r--r-- | modules/migrations/base/uploader.go | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/modules/migrations/base/comment.go b/modules/migrations/base/comment.go index 0ff0963f07..d89ec3a3f5 100644 --- a/modules/migrations/base/comment.go +++ b/modules/migrations/base/comment.go @@ -9,6 +9,7 @@ import "time" // Comment is a standard comment information type Comment struct { + IssueIndex int64 PosterName string PosterEmail string Created time.Time diff --git a/modules/migrations/base/uploader.go b/modules/migrations/base/uploader.go index eaeb10314a..096a8ab8f0 100644 --- a/modules/migrations/base/uploader.go +++ b/modules/migrations/base/uploader.go @@ -5,14 +5,14 @@ package base -// Uploader uploads all the informations +// Uploader uploads all the informations of one repository type Uploader interface { CreateRepo(repo *Repository, includeWiki bool) error - CreateMilestone(milestone *Milestone) error - CreateRelease(release *Release) error - CreateLabel(label *Label) error - CreateIssue(issue *Issue) error - CreateComment(issueNumber int64, comment *Comment) error - CreatePullRequest(pr *PullRequest) error + CreateMilestones(milestones ...*Milestone) error + CreateReleases(releases ...*Release) error + CreateLabels(labels ...*Label) error + CreateIssues(issues ...*Issue) error + CreateComments(comments ...*Comment) error + CreatePullRequests(prs ...*PullRequest) error Rollback() error } |