summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-09-08 23:01:19 +0800
committerGitHub <noreply@github.com>2023-09-08 23:01:19 +0800
commit9c0a3532a4765263f279caeabd7f696372ce1d1f (patch)
tree4ed801ef304d923617af7733a6966f166bebc80e /models/migrations
parentffa4949eaaf645995c5a20cd302d0256417b97ed (diff)
downloadgitea-9c0a3532a4765263f279caeabd7f696372ce1d1f.tar.gz
gitea-9c0a3532a4765263f279caeabd7f696372ce1d1f.zip
Add a new column schedule_id for action_run to track (#26975)
Fix #26971 And the UI now will display it's scheduled but not triggered by a push. <img width="954" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365">
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v1_21/v275.go15
2 files changed, 17 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 40df1cd624..f0a8b05d53 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -530,6 +530,8 @@ var migrations = []Migration{
NewMigration("Add Action Schedule Table", v1_21.AddActionScheduleTable),
// v274 -> v275
NewMigration("Add Actions artifacts expiration date", v1_21.AddExpiredUnixColumnInActionArtifactTable),
+ // v275 -> v276
+ NewMigration("Add ScheduleID for ActionRun", v1_21.AddScheduleIDForActionRun),
}
// GetCurrentDBVersion returns the current db version
diff --git a/models/migrations/v1_21/v275.go b/models/migrations/v1_21/v275.go
new file mode 100644
index 0000000000..78804a59d6
--- /dev/null
+++ b/models/migrations/v1_21/v275.go
@@ -0,0 +1,15 @@
+// Copyright 2023 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package v1_21 //nolint
+
+import (
+ "xorm.io/xorm"
+)
+
+func AddScheduleIDForActionRun(x *xorm.Engine) error {
+ type ActionRun struct {
+ ScheduleID int64
+ }
+ return x.Sync(new(ActionRun))
+}