mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-06 23:38:48 +02:00
feat: Adapt the migration
This commit is contained in:
parent
c06bfe95e5
commit
66ee950a42
@ -405,7 +405,7 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(328, "Add TokenPermissions column to ActionRunJob", v1_26.AddTokenPermissionsToActionRunJob),
|
||||
newMigration(329, "Add unique constraint for user badge", v1_26.AddUniqueIndexForUserBadge),
|
||||
newMigration(330, "Add name column to webhook", v1_26.AddNameToWebhook),
|
||||
newMigration(331, "Add runner capacity and job max-parallel support", v1_26.AddRunnerCapacityAndJobMaxParallel),
|
||||
newMigration(331, "Add job max-parallel support", v1_26.AddJobMaxParallel),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
17
models/migrations/v1_26/v331.go
Normal file
17
models/migrations/v1_26/v331.go
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_26
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
// AddJobMaxParallel adds max_parallel to action_run_job with a composite index on (run_id, job_id).
|
||||
func AddJobMaxParallel(x *xorm.Engine) error {
|
||||
type ActionRunJob struct {
|
||||
RunID int64 `xorm:"index index(idx_run_id_job_id)"`
|
||||
JobID string `xorm:"VARCHAR(255) index(idx_run_id_job_id)"`
|
||||
MaxParallel int `xorm:"NOT NULL DEFAULT 0"`
|
||||
}
|
||||
|
||||
return x.Sync(new(ActionRunJob))
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user