diff options
Diffstat (limited to 'modules/migrations')
-rw-r--r-- | modules/migrations/gitea.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/migrations/gitea.go b/modules/migrations/gitea.go index 08244e5ab2..ddfc2ca271 100644 --- a/modules/migrations/gitea.go +++ b/modules/migrations/gitea.go @@ -21,7 +21,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/migrations/base" "code.gitea.io/gitea/modules/setting" - "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/modules/timeutil" gouuid "github.com/satori/go.uuid" ) @@ -106,12 +106,12 @@ func (g *GiteaLocalUploader) CreateTopics(topics ...string) error { func (g *GiteaLocalUploader) CreateMilestones(milestones ...*base.Milestone) error { var mss = make([]*models.Milestone, 0, len(milestones)) for _, milestone := range milestones { - var deadline util.TimeStamp + var deadline timeutil.TimeStamp if milestone.Deadline != nil { - deadline = util.TimeStamp(milestone.Deadline.Unix()) + deadline = timeutil.TimeStamp(milestone.Deadline.Unix()) } if deadline == 0 { - deadline = util.TimeStamp(time.Date(9999, 1, 1, 0, 0, 0, 0, setting.UILocation).Unix()) + deadline = timeutil.TimeStamp(time.Date(9999, 1, 1, 0, 0, 0, 0, setting.DefaultUILocation).Unix()) } var ms = models.Milestone{ RepoID: g.repo.ID, @@ -121,7 +121,7 @@ func (g *GiteaLocalUploader) CreateMilestones(milestones ...*base.Milestone) err DeadlineUnix: deadline, } if ms.IsClosed && milestone.Closed != nil { - ms.ClosedDateUnix = util.TimeStamp(milestone.Closed.Unix()) + ms.ClosedDateUnix = timeutil.TimeStamp(milestone.Closed.Unix()) } mss = append(mss, &ms) } @@ -175,7 +175,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error { IsDraft: release.Draft, IsPrerelease: release.Prerelease, IsTag: false, - CreatedUnix: util.TimeStamp(release.Created.Unix()), + CreatedUnix: timeutil.TimeStamp(release.Created.Unix()), } // calc NumCommits @@ -194,7 +194,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error { Name: asset.Name, DownloadCount: int64(*asset.DownloadCount), Size: int64(*asset.Size), - CreatedUnix: util.TimeStamp(asset.Created.Unix()), + CreatedUnix: timeutil.TimeStamp(asset.Created.Unix()), } // download attachment @@ -265,10 +265,10 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error { IsLocked: issue.IsLocked, MilestoneID: milestoneID, Labels: labels, - CreatedUnix: util.TimeStamp(issue.Created.Unix()), + CreatedUnix: timeutil.TimeStamp(issue.Created.Unix()), } if issue.Closed != nil { - is.ClosedUnix = util.TimeStamp(issue.Closed.Unix()) + is.ClosedUnix = timeutil.TimeStamp(issue.Closed.Unix()) } // TODO: add reactions iss = append(iss, &is) @@ -307,7 +307,7 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error { OriginalAuthor: comment.PosterName, OriginalAuthorID: comment.PosterID, Content: comment.Content, - CreatedUnix: util.TimeStamp(comment.Created.Unix()), + CreatedUnix: timeutil.TimeStamp(comment.Created.Unix()), }) // TODO: Reactions @@ -453,15 +453,15 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR IsClosed: pr.State == "closed", IsLocked: pr.IsLocked, Labels: labels, - CreatedUnix: util.TimeStamp(pr.Created.Unix()), + CreatedUnix: timeutil.TimeStamp(pr.Created.Unix()), }, } if pullRequest.Issue.IsClosed && pr.Closed != nil { - pullRequest.Issue.ClosedUnix = util.TimeStamp(pr.Closed.Unix()) + pullRequest.Issue.ClosedUnix = timeutil.TimeStamp(pr.Closed.Unix()) } if pullRequest.HasMerged && pr.MergedTime != nil { - pullRequest.MergedUnix = util.TimeStamp(pr.MergedTime.Unix()) + pullRequest.MergedUnix = timeutil.TimeStamp(pr.MergedTime.Unix()) pullRequest.MergedCommitID = pr.MergeCommitSHA pullRequest.MergerID = g.doer.ID } |