summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-03-13 04:03:55 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-03-13 10:03:55 +0800
commitc0d41b1b77169553006bd9211d025de4da8bafd8 (patch)
tree95c704bdd07576766e2c29533578da2f3002ab64 /models/migrations
parentad33730dcaffed632200316a5ce5675b30ed1e99 (diff)
downloadgitea-c0d41b1b77169553006bd9211d025de4da8bafd8.tar.gz
gitea-c0d41b1b77169553006bd9211d025de4da8bafd8.zip
Add label descriptions (#3662)
* Add label descriptions * Add default descriptions to label template
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v58.go22
2 files changed, 24 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index cc40bd8272..cc5d0bae81 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -168,6 +168,8 @@ var migrations = []Migration{
NewMigration("remove is_owner, num_teams columns from org_user", removeIsOwnerColumnFromOrgUser),
// v57 -> v58
NewMigration("add closed_unix column for issues", addIssueClosedTime),
+ // v58 -> v59
+ NewMigration("add label descriptions", addLabelsDescriptions),
}
// Migrate database to current version
diff --git a/models/migrations/v58.go b/models/migrations/v58.go
new file mode 100644
index 0000000000..6ec24b08c8
--- /dev/null
+++ b/models/migrations/v58.go
@@ -0,0 +1,22 @@
+// Copyright 2018 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 (
+ "fmt"
+
+ "github.com/go-xorm/xorm"
+)
+
+func addLabelsDescriptions(x *xorm.Engine) error {
+ type Label struct {
+ Description string
+ }
+
+ if err := x.Sync2(new(Label)); err != nil {
+ return fmt.Errorf("Sync2: %v", err)
+ }
+ return nil
+}