Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Protected Branches to Whitelist Deploy Keys #8483

Merged
Prev Previous commit
Next Next commit
Merge branch 'master' into fix-8472-add-option-for-whitelist-deploy-key
  • Loading branch information
zeripath committed Oct 20, 2019
commit 7808ea61be05eba0182785d46d74042534721416
4 changes: 4 additions & 0 deletions models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ var migrations = []Migration{
// v100 -> v101
NewMigration("update migration repositories' service type", updateMigrationServiceTypes),
// v101 -> v102
NewMigration("change length of some external login users columns", changeSomeColumnsLengthOfExternalLoginUser),
// v102 -> v103
NewMigration("update migration repositories' service type", dropColumnHeadUserNameOnPullRequest),
// v103 -> v104
NewMigration("Add WhitelistDeployKeys to protected branch", addWhitelistDeployKeysToBranches),
}

Expand Down
15 changes: 9 additions & 6 deletions models/migrations/v101.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

package migrations

import "github.com/go-xorm/xorm"
import (
"xorm.io/xorm"
)

func addWhitelistDeployKeysToBranches(x *xorm.Engine) error {
type ProtectedBranch struct {
ID int64
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
func changeSomeColumnsLengthOfExternalLoginUser(x *xorm.Engine) error {
type ExternalLoginUser struct {
AccessToken string `xorm:"TEXT"`
AccessTokenSecret string `xorm:"TEXT"`
RefreshToken string `xorm:"TEXT"`
}

return x.Sync2(new(ProtectedBranch))
return x.Sync2(new(ExternalLoginUser))
}
18 changes: 18 additions & 0 deletions models/migrations/v103.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
"xorm.io/xorm"
)

func addWhitelistDeployKeysToBranches(x *xorm.Engine) error {
type ProtectedBranch struct {
ID int64
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
}

return x.Sync2(new(ProtectedBranch))
}
You are viewing a condensed version of this merge commit. You can view the full changes here.