1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add migrations and doctor fixes (#33556)

Fix #33535
This commit is contained in:
Lunny Xiao
2025-03-02 21:01:28 -08:00
committed by GitHub
parent 02657e85a4
commit dbed39d632
6 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_24 //nolint
import (
"xorm.io/xorm"
)
func UpdateOwnerIDOfRepoLevelActionsTables(x *xorm.Engine) error {
if _, err := x.Exec("UPDATE `action_runner` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0"); err != nil {
return err
}
if _, err := x.Exec("UPDATE `action_variable` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0"); err != nil {
return err
}
_, err := x.Exec("UPDATE `secret` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0")
return err
}