summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-01-23 19:58:38 +0100
committertechknowlogick <matti@mdranta.net>2019-01-23 13:58:38 -0500
commit0b510725c97452bac57ff0080df10f6177aa2a6e (patch)
treeb9405cf290057698b32cf0acacc0d627f223ed6d /models/repo.go
parent6ad834e236756e7ba3de27e59681080a7ec4fcf1 (diff)
downloadgitea-0b510725c97452bac57ff0080df10f6177aa2a6e.tar.gz
gitea-0b510725c97452bac57ff0080df10f6177aa2a6e.zip
Feature: Archive repos (#5009)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index d2b163ff65..0a00e6c7a8 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -186,8 +186,9 @@ type Repository struct {
NumOpenMilestones int `xorm:"-"`
NumReleases int `xorm:"-"`
- IsPrivate bool `xorm:"INDEX"`
- IsEmpty bool `xorm:"INDEX"`
+ IsPrivate bool `xorm:"INDEX"`
+ IsEmpty bool `xorm:"INDEX"`
+ IsArchived bool `xorm:"INDEX"`
IsMirror bool `xorm:"INDEX"`
*Mirror `xorm:"-"`
@@ -292,6 +293,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
Description: repo.Description,
Private: repo.IsPrivate,
Empty: repo.IsEmpty,
+ Archived: repo.IsArchived,
Size: int(repo.Size / 1024),
Fork: repo.IsFork,
Parent: parent,
@@ -2341,6 +2343,13 @@ func CheckRepoStats() {
// ***** END: Repository.NumForks *****
}
+// SetArchiveRepoState sets if a repo is archived
+func (repo *Repository) SetArchiveRepoState(isArchived bool) (err error) {
+ repo.IsArchived = isArchived
+ _, err = x.Where("id = ?", repo.ID).Cols("is_archived").Update(repo)
+ return
+}
+
// ___________ __
// \_ _____/__________| | __
// | __)/ _ \_ __ \ |/ /