summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorAnbraten <anton@ju60.de>2021-12-08 07:57:18 +0100
committerGitHub <noreply@github.com>2021-12-08 14:57:18 +0800
commit0ff18a808c7c14d42ea2325b5d9623f7a30d9107 (patch)
tree6271529776d63a8c741bc3159cd5cfacd5539be1 /models/migrations
parent4cbe792562e69e76df07cfa4aa9c0c254b2dec7c (diff)
downloadgitea-0ff18a808c7c14d42ea2325b5d9623f7a30d9107.tar.gz
gitea-0ff18a808c7c14d42ea2325b5d9623f7a30d9107.zip
Support sorting for project board issuses (#17152)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v203.go18
2 files changed, 20 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 6b7caba897..a5bacd0d92 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -359,6 +359,8 @@ var migrations = []Migration{
NewMigration("Drop table remote_version (if exists)", dropTableRemoteVersion),
// v202 -> v203
NewMigration("Create key/value table for user settings", createUserSettingsTable),
+ // v203 -> v204
+ NewMigration("Add Sorting to ProjectIssue table", addProjectIssueSorting),
}
// GetCurrentDBVersion returns the current db version
diff --git a/models/migrations/v203.go b/models/migrations/v203.go
new file mode 100644
index 0000000000..2e1dd7289a
--- /dev/null
+++ b/models/migrations/v203.go
@@ -0,0 +1,18 @@
+// 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 (
+ "xorm.io/xorm"
+)
+
+func addProjectIssueSorting(x *xorm.Engine) error {
+ // ProjectIssue saves relation from issue to a project
+ type ProjectIssue struct {
+ Sorting int64 `xorm:"NOT NULL DEFAULT 0"`
+ }
+
+ return x.Sync2(new(ProjectIssue))
+}