Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_27
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dev/modelmigration/base"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
// AddReusableWorkflowFieldsToActionRunJob adds the ActionRunJob columns that describe the reusable workflow caller hierarchy,
|
|
// and the ActionRunAttemptJobIDIndex table backing run-wide AttemptJobID allocation.
|
|
func AddReusableWorkflowFieldsToActionRunJob(_ context.Context, x base.EngineMigration) error {
|
|
type ActionRunJob struct {
|
|
WorkflowSourceRepoID int64 `xorm:"NOT NULL DEFAULT 0"`
|
|
WorkflowSourceCommitSHA string `xorm:"VARCHAR(64) NOT NULL DEFAULT ''"`
|
|
IsReusableCaller bool `xorm:"index NOT NULL DEFAULT FALSE"`
|
|
ParentJobID int64 `xorm:"index NOT NULL DEFAULT 0"`
|
|
CallUses string `xorm:"VARCHAR(512) NOT NULL DEFAULT ''"`
|
|
CallSecrets string `xorm:"LONGTEXT"`
|
|
CallPayload string `xorm:"LONGTEXT"`
|
|
IsExpanded bool `xorm:"NOT NULL DEFAULT FALSE"`
|
|
ReusableWorkflowContent []byte `xorm:"LONGBLOB"`
|
|
}
|
|
|
|
type ActionRunAttemptJobIDIndex base.ResourceIndex
|
|
|
|
if _, err := x.SyncWithOptions(xorm.SyncOptions{IgnoreDropIndices: true}, new(ActionRunJob)); err != nil {
|
|
return err
|
|
}
|
|
return x.Sync(new(ActionRunAttemptJobIDIndex))
|
|
}
|