diff options
author | Romain <romdum@users.noreply.github.com> | 2021-09-29 22:53:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 22:53:12 +0200 |
commit | ecfac78f6ef2cc01e4397c1a92b9a59b7ff0b2ff (patch) | |
tree | 161b9c6fcae7bbda0a827f565fdcc07cadd756ee /models/migrations | |
parent | ba1fdbcfdb26ce7088a7eab0175e224e5325ef72 (diff) | |
download | gitea-ecfac78f6ef2cc01e4397c1a92b9a59b7ff0b2ff.tar.gz gitea-ecfac78f6ef2cc01e4397c1a92b9a59b7ff0b2ff.zip |
Kanban colored boards (#16647)
Add a column Color in ProjectBoard and color picker in new / edit project board form.
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 2 | ||||
-rw-r--r-- | models/migrations/v196.go | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 753ca063d9..33b094e48c 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -344,6 +344,8 @@ var migrations = []Migration{ NewMigration("Add Branch Protection Unprotected Files Column", addBranchProtectionUnprotectedFilesColumn), // v195 -> v196 NewMigration("Add table commit_status_index", addTableCommitStatusIndex), + // v196 -> v197 + NewMigration("Add Color to ProjectBoard table", addColorColToProjectBoard), } // GetCurrentDBVersion returns the current db version diff --git a/models/migrations/v196.go b/models/migrations/v196.go new file mode 100644 index 0000000000..c0332c7bb4 --- /dev/null +++ b/models/migrations/v196.go @@ -0,0 +1,22 @@ +// Copyright 2021 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" + + "xorm.io/xorm" +) + +func addColorColToProjectBoard(x *xorm.Engine) error { + type ProjectBoard struct { + Color string `xorm:"VARCHAR(7)"` + } + + if err := x.Sync2(new(ProjectBoard)); err != nil { + return fmt.Errorf("Sync2: %v", err) + } + return nil +} |