Add label descriptions (#3662)

* Add label descriptions

* Add default descriptions to label template
This commit is contained in:
Lauris BH 2018-03-13 04:03:55 +02:00 committed by Lunny Xiao
parent ad33730dca
commit c0d41b1b77
14 changed files with 109 additions and 34 deletions

View file

@ -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

22
models/migrations/v58.go Normal file
View file

@ -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
}