diff options
author | Lauris BH <lauris@nix.lv> | 2017-07-17 05:04:43 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-07-17 10:04:43 +0800 |
commit | f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee (patch) | |
tree | 2c6a268356fcb5fd73ee468055869b129b14c6ed /models/migrations/v16.go | |
parent | 047a67a90b455a077e8b6f6deaad6b7ec4b50810 (diff) | |
download | gitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.tar.gz gitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.zip |
Remove unit types commits and settings (#2161)
* Remove unit types commits and settings
* Can not limit units in administrator teams
* Limit changing units only to teams with read and write access mode
* Small code optimization
Diffstat (limited to 'models/migrations/v16.go')
-rw-r--r-- | models/migrations/v16.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/models/migrations/v16.go b/models/migrations/v16.go index 12cad46d09..9cd4ef4da2 100644 --- a/models/migrations/v16.go +++ b/models/migrations/v16.go @@ -26,15 +26,15 @@ type RepoUnit struct { // Enumerate all the unit types const ( - UnitTypeCode = iota + 1 // 1 code - UnitTypeIssues // 2 issues - UnitTypePRs // 3 PRs - UnitTypeCommits // 4 Commits - UnitTypeReleases // 5 Releases - UnitTypeWiki // 6 Wiki - UnitTypeSettings // 7 Settings - UnitTypeExternalWiki // 8 ExternalWiki - UnitTypeExternalTracker // 9 ExternalTracker + V16UnitTypeCode = iota + 1 // 1 code + V16UnitTypeIssues // 2 issues + V16UnitTypePRs // 3 PRs + V16UnitTypeCommits // 4 Commits + V16UnitTypeReleases // 5 Releases + V16UnitTypeWiki // 6 Wiki + V16UnitTypeSettings // 7 Settings + V16UnitTypeExternalWiki // 8 ExternalWiki + V16UnitTypeExternalTracker // 9 ExternalTracker ) // Repo describes a repository @@ -79,32 +79,32 @@ func addUnitsToTables(x *xorm.Engine) error { for _, repo := range repos { for i := 1; i <= 9; i++ { - if (i == UnitTypeWiki || i == UnitTypeExternalWiki) && !repo.EnableWiki { + if (i == V16UnitTypeWiki || i == V16UnitTypeExternalWiki) && !repo.EnableWiki { continue } - if i == UnitTypeExternalWiki && !repo.EnableExternalWiki { + if i == V16UnitTypeExternalWiki && !repo.EnableExternalWiki { continue } - if i == UnitTypePRs && !repo.EnablePulls { + if i == V16UnitTypePRs && !repo.EnablePulls { continue } - if (i == UnitTypeIssues || i == UnitTypeExternalTracker) && !repo.EnableIssues { + if (i == V16UnitTypeIssues || i == V16UnitTypeExternalTracker) && !repo.EnableIssues { continue } - if i == UnitTypeExternalTracker && !repo.EnableExternalTracker { + if i == V16UnitTypeExternalTracker && !repo.EnableExternalTracker { continue } var config = make(map[string]string) switch i { - case UnitTypeExternalTracker: + case V16UnitTypeExternalTracker: config["ExternalTrackerURL"] = repo.ExternalTrackerURL config["ExternalTrackerFormat"] = repo.ExternalTrackerFormat if len(repo.ExternalTrackerStyle) == 0 { repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric } config["ExternalTrackerStyle"] = repo.ExternalTrackerStyle - case UnitTypeExternalWiki: + case V16UnitTypeExternalWiki: config["ExternalWikiURL"] = repo.ExternalWikiURL } |