mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-01 14:56:30 +00:00
fix: rename table name string
This commit is contained in:
parent
04d72d3500
commit
e33d4d7700
@ -108,11 +108,11 @@ func (run *BotRun) GetPushEventPayload() (*api.PushPayload, error) {
|
||||
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
|
||||
_, err := db.GetEngine(ctx).ID(repo.ID).
|
||||
SetExpr("num_runs",
|
||||
builder.Select("count(*)").From("bots_run").
|
||||
builder.Select("count(*)").From("bot_run").
|
||||
Where(builder.Eq{"repo_id": repo.ID}),
|
||||
).
|
||||
SetExpr("num_closed_runs",
|
||||
builder.Select("count(*)").From("bots_run").
|
||||
builder.Select("count(*)").From("bot_run").
|
||||
Where(builder.Eq{
|
||||
"repo_id": repo.ID,
|
||||
}.And(
|
||||
@ -137,7 +137,7 @@ func InsertRun(run *BotRun, jobs []*jobparser.SingleWorkflow) error {
|
||||
}
|
||||
defer commiter.Close()
|
||||
|
||||
index, err := db.GetNextResourceIndex(ctx, "bots_run_index", run.RepoID)
|
||||
index, err := db.GetNextResourceIndex(ctx, "bot_run_index", run.RepoID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ func (opts FindRunnerOptions) toOrder() string {
|
||||
|
||||
func CountRunners(opts FindRunnerOptions) (int64, error) {
|
||||
return db.GetEngine(db.DefaultContext).
|
||||
Table("bots_runner").
|
||||
Table(BotRunner{}).
|
||||
Where(opts.toCond()).
|
||||
OrderBy(opts.toOrder()).
|
||||
Count()
|
||||
|
Loading…
Reference in New Issue
Block a user