From bfc61b4a3dfacfb4c9aa9d4837999cca4d5c83e8 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 29 Oct 2021 10:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=BB=93=E5=BA=93=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=92=8C=E6=98=AF=E5=90=A6=E7=A7=81=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/repo_statistic.go | 6 ++++-- routers/repo/repo_statistic.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/models/repo_statistic.go b/models/repo_statistic.go index 9863c331a..adef672e0 100755 --- a/models/repo_statistic.go +++ b/models/repo_statistic.go @@ -9,8 +9,10 @@ import ( // RepoStatistic statistic info of all repository type RepoStatistic struct { - ID int64 `xorm:"pk autoincr"` - RepoID int64 `xorm:"unique(s) NOT NULL"` + ID int64 `xorm:"pk autoincr"` + RepoID int64 `xorm:"unique(s) NOT NULL"` + Name string `xorm:"INDEX"` + IsPrivate bool Date string `xorm:"unique(s) NOT NULL"` NumWatches int64 `xorm:"NOT NULL DEFAULT 0"` NumWatchesAdded int64 `xorm:"NOT NULL DEFAULT 0"` diff --git a/routers/repo/repo_statistic.go b/routers/repo/repo_statistic.go index 9bc70eaff..2de22a1ee 100755 --- a/routers/repo/repo_statistic.go +++ b/routers/repo/repo_statistic.go @@ -89,6 +89,8 @@ func RepoStatisticDaily(date string) { repoStat := models.RepoStatistic{ RepoID: repo.ID, Date: date, + Name: repo.Name, + IsPrivate: repo.IsPrivate, NumWatches: int64(repo.NumWatches), NumStars: int64(repo.NumStars), NumDownloads: repo.CloneCnt,