Browse Source

记录仓库名称和是否私有

tags/v1.21.12.1
ychao_1983 3 years ago
parent
commit
bfc61b4a3d
2 changed files with 6 additions and 2 deletions
  1. +4
    -2
      models/repo_statistic.go
  2. +2
    -0
      routers/repo/repo_statistic.go

+ 4
- 2
models/repo_statistic.go View File

@@ -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"`


+ 2
- 0
routers/repo/repo_statistic.go View File

@@ -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,


Loading…
Cancel
Save