Skip to content

Commit 6ce01c1

Browse files
Add database migration
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
1 parent dbe81c0 commit 6ce01c1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

models/migrations/migrations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ var migrations = []Migration{
244244
NewMigration("add email notification enabled preference to user", addEmailNotificationEnabledToUser),
245245
// v94 -> v95
246246
NewMigration("add enable_status_check, status_check_contexts to protected_branch", addStatusCheckColumnsForProtectedBranches),
247+
// v95 -> v96
248+
NewMigration("add repo_admin_change_team_access to user", addRepoAdminChangeTeamAccessColumnForUser),
247249
}
248250

249251
// Migrate database to current version

models/migrations/v95.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package migrations
6+
7+
import "github.com/go-xorm/xorm"
8+
9+
func addRepoAdminChangeTeamAccessColumnForUser(x *xorm.Engine) error {
10+
type User struct {
11+
RepoAdminChangeTeamAccess bool `xorm:"NOT NULL DEFAULT false"`
12+
}
13+
14+
return x.Sync2(new(User))
15+
}

0 commit comments

Comments
 (0)