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

@@ -12,6 +12,7 @@ import (
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/migrations"
repo_model "code.gitea.io/gitea/models/repo"
secret_model "code.gitea.io/gitea/models/secret"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
)
@@ -164,6 +165,24 @@ func prepareDBConsistencyChecks() []consistencyCheck {
Fixer: repo_model.DeleteOrphanedTopics,
FixedMessage: "Removed",
},
{
Name: "Repository level Runners with non-zero owner_id",
Counter: actions_model.CountWrongRepoLevelRunners,
Fixer: actions_model.UpdateWrongRepoLevelRunners,
FixedMessage: "Corrected",
},
{
Name: "Repository level Variables with non-zero owner_id",
Counter: actions_model.CountWrongRepoLevelVariables,
Fixer: actions_model.UpdateWrongRepoLevelVariables,
FixedMessage: "Corrected",
},
{
Name: "Repository level Secrets with non-zero owner_id",
Counter: secret_model.CountWrongRepoLevelSecrets,
Fixer: secret_model.UpdateWrongRepoLevelSecrets,
FixedMessage: "Corrected",
},
}
// TODO: function to recalc all counters