summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-05-18 22:54:24 +0800
committerGitHub <noreply@github.com>2017-05-18 22:54:24 +0800
commitfd6034aaf23af1ce03bcba0babcbe7675ce093ee (patch)
tree9720f416facdef02a76bd56ca50669cc1f17eb88 /models/migrations
parent5db5e16ab61f25f21cb17ee4895679b9830641a5 (diff)
downloadgitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.tar.gz
gitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.zip
Add units to team (#947)
* add units to team * fix lint * finish team setting backend * finished permission controll on routes * fix import blank line * add unit check on ssh/http pull and push and fix test failed * fix fixtures data * remove unused code
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v31.go2
-rw-r--r--models/migrations/v32.go23
3 files changed, 26 insertions, 1 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 000412ae37..2973064152 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -112,6 +112,8 @@ var migrations = []Migration{
NewMigration("add primary key to external login user", addExternalLoginUserPK),
// 31 -> 32
NewMigration("add field for login source synchronization", addLoginSourceSyncEnabledColumn),
+ // v32 -> v33
+ NewMigration("add units for team", addUnitsToRepoTeam),
}
// Migrate database to current version
diff --git a/models/migrations/v31.go b/models/migrations/v31.go
index 1166a5f6c4..b7ceecfc38 100644
--- a/models/migrations/v31.go
+++ b/models/migrations/v31.go
@@ -1,4 +1,4 @@
-// Copyright 2017 The Gogs Authors. All rights reserved.
+// Copyright 2017 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.
diff --git a/models/migrations/v32.go b/models/migrations/v32.go
new file mode 100644
index 0000000000..d209fc34f6
--- /dev/null
+++ b/models/migrations/v32.go
@@ -0,0 +1,23 @@
+// Copyright 2017 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 "github.com/go-xorm/xorm"
+
+func addUnitsToRepoTeam(x *xorm.Engine) error {
+ type Team struct {
+ UnitTypes []int `xorm:"json"`
+ }
+
+ err := x.Sync(new(Team))
+ if err != nil {
+ return err
+ }
+
+ _, err = x.Update(&Team{
+ UnitTypes: []int{1, 2, 3, 4, 5, 6, 7, 8, 9},
+ })
+ return err
+}