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 {
|
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
|
||||||
_, err := db.GetEngine(ctx).ID(repo.ID).
|
_, err := db.GetEngine(ctx).ID(repo.ID).
|
||||||
SetExpr("num_runs",
|
SetExpr("num_runs",
|
||||||
builder.Select("count(*)").From("bots_run").
|
builder.Select("count(*)").From("bot_run").
|
||||||
Where(builder.Eq{"repo_id": repo.ID}),
|
Where(builder.Eq{"repo_id": repo.ID}),
|
||||||
).
|
).
|
||||||
SetExpr("num_closed_runs",
|
SetExpr("num_closed_runs",
|
||||||
builder.Select("count(*)").From("bots_run").
|
builder.Select("count(*)").From("bot_run").
|
||||||
Where(builder.Eq{
|
Where(builder.Eq{
|
||||||
"repo_id": repo.ID,
|
"repo_id": repo.ID,
|
||||||
}.And(
|
}.And(
|
||||||
@ -137,7 +137,7 @@ func InsertRun(run *BotRun, jobs []*jobparser.SingleWorkflow) error {
|
|||||||
}
|
}
|
||||||
defer commiter.Close()
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ func (opts FindRunnerOptions) toOrder() string {
|
|||||||
|
|
||||||
func CountRunners(opts FindRunnerOptions) (int64, error) {
|
func CountRunners(opts FindRunnerOptions) (int64, error) {
|
||||||
return db.GetEngine(db.DefaultContext).
|
return db.GetEngine(db.DefaultContext).
|
||||||
Table("bots_runner").
|
Table(BotRunner{}).
|
||||||
Where(opts.toCond()).
|
Where(opts.toCond()).
|
||||||
OrderBy(opts.toOrder()).
|
OrderBy(opts.toOrder()).
|
||||||
Count()
|
Count()
|
||||||
|
Loading…
Reference in New Issue
Block a user