aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-04-14 20:16:54 +0800
committerGitHub <noreply@github.com>2024-04-14 14:16:54 +0200
commite20428d8f64697d7c6418b42d0a8e57d1d3f588c (patch)
tree46dae1c9a08e2ab8766bbca741fea1d0a346e374 /models/migrations
parentf3267548abfd4deda1aaeb4b336df6cd4b0e1d70 (diff)
downloadgitea-e20428d8f64697d7c6418b42d0a8e57d1d3f588c.tar.gz
gitea-e20428d8f64697d7c6418b42d0a8e57d1d3f588c.zip
Fix commitstatus summary (#30431)
The target_url is necessary for the UI, but missed in commit_status_summary table. This PR fix it. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v1_23/v296.go16
2 files changed, 18 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 3ea8f2acbf..5326d48f90 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -580,6 +580,8 @@ var migrations = []Migration{
NewMigration("Add unique index for project issue table", v1_23.AddUniqueIndexForProjectIssue),
// v295 -> v296
NewMigration("Add commit status summary table", v1_23.AddCommitStatusSummary),
+ // v296 -> v297
+ NewMigration("Add missing field of commit status summary table", v1_23.AddCommitStatusSummary2),
}
// GetCurrentDBVersion returns the current db version
diff --git a/models/migrations/v1_23/v296.go b/models/migrations/v1_23/v296.go
new file mode 100644
index 0000000000..495ae2ab23
--- /dev/null
+++ b/models/migrations/v1_23/v296.go
@@ -0,0 +1,16 @@
+// Copyright 2024 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package v1_23 //nolint
+
+import "xorm.io/xorm"
+
+func AddCommitStatusSummary2(x *xorm.Engine) error {
+ type CommitStatusSummary struct {
+ ID int64 `xorm:"pk autoincr"`
+ TargetURL string `xorm:"TEXT"`
+ }
+ // there is no migrations because if there is no data on this table, it will fall back to get data
+ // from commit status
+ return x.Sync(new(CommitStatusSummary))
+}