aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v196.go22
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
+}