chore: add ids to task

This commit is contained in:
Jason Song
2022-11-11 16:52:22 +08:00
parent 381d06729b
commit e19f2c8c44
3 changed files with 48 additions and 18 deletions

View File

@ -97,22 +97,32 @@ func addBotTables(x *xorm.Engine) error {
type BotsRunIndex db.ResourceIndex
type BotsTask struct {
ID int64
JobID int64
Attempt int64
RunnerID int64 `xorm:"index"`
Result int32
Status int `xorm:"index"`
Started timeutil.TimeStamp
Stopped timeutil.TimeStamp
ID int64
JobID int64
Attempt int64
RunnerID int64 `xorm:"index"`
Result int32
Status int `xorm:"index"`
Started timeutil.TimeStamp `xorm:"index"`
Stopped timeutil.TimeStamp
RepoID int64 `xorm:"index"`
OwnerID int64 `xorm:"index"`
CommitSHA string `xorm:"index"`
TokenHash string `xorm:"UNIQUE"` // sha256 of token
TokenSalt string
TokenLastEight string `xorm:"token_last_eight"`
LogFilename string // file name of log
LogInStorage bool // read log from database or from storage
LogLength int64 // lines count
LogSize int64 // blob size
LogIndexes *[]int64 `xorm:"BLOB"` // line number to offset
LogExpired bool
Created timeutil.TimeStamp `xorm:"created"`
Updated timeutil.TimeStamp `xorm:"updated"`
LogExpired bool // files that are too old will be deleted
Created timeutil.TimeStamp `xorm:"created"`
Updated timeutil.TimeStamp `xorm:"updated index"`
}
type BotsTaskStep struct {