fix: add restraints for models

This commit is contained in:
Jason Song 2023-01-04 16:43:40 +08:00
parent 7f6a803d24
commit 2c686e8826
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5
4 changed files with 12 additions and 12 deletions

View File

@ -25,10 +25,10 @@ type ActionRunJob struct {
OwnerID int64 `xorm:"index"`
CommitSHA string `xorm:"index"`
IsForkPullRequest bool
Name string
Name string `xorm:"VARCHAR(255)"`
Attempt int64
WorkflowPayload []byte
JobID string // job id in workflow, not job's id
JobID string `xorm:"VARCHAR(255)"` // job id in workflow, not job's id
Needs []string `xorm:"JSON TEXT"`
RunsOn []string `xorm:"JSON TEXT"`
TaskID int64 // the latest task of the job

View File

@ -23,7 +23,7 @@ import (
type ActionRunner struct {
ID int64
UUID string `xorm:"CHAR(36) UNIQUE"`
Name string `xorm:"VARCHAR(32)"`
Name string `xorm:"VARCHAR(255)"`
OwnerID int64 `xorm:"index"` // org level runner, 0 means system
Owner *user_model.User `xorm:"-"`
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global

View File

@ -14,7 +14,7 @@ import (
// ActionTaskStep represents a step of ActionTask
type ActionTaskStep struct {
ID int64
Name string
Name string `xorm:"VARCHAR(255)"`
TaskID int64 `xorm:"index unique(task_number)"`
Number int64 `xorm:"index unique(task_number)"`
RepoID int64 `xorm:"index"`

View File

@ -14,7 +14,7 @@ func AddActionsTables(x *xorm.Engine) error {
type ActionRunner struct {
ID int64
UUID string `xorm:"CHAR(36) UNIQUE"`
Name string `xorm:"VARCHAR(32)"`
Name string `xorm:"VARCHAR(255)"`
OwnerID int64 `xorm:"index"` // org level runner, 0 means system
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global
Description string `xorm:"TEXT"`
@ -78,10 +78,10 @@ func AddActionsTables(x *xorm.Engine) error {
OwnerID int64 `xorm:"index"`
CommitSHA string `xorm:"index"`
IsForkPullRequest bool
Name string
Name string `xorm:"VARCHAR(255)"`
Attempt int64
WorkflowPayload []byte
JobID string // job id in workflow, not job's id
JobID string `xorm:"VARCHAR(255)"` // job id in workflow, not job's id
Needs []string `xorm:"JSON TEXT"`
RunsOn []string `xorm:"JSON TEXT"`
TaskID int64 // the latest task of the job
@ -130,11 +130,11 @@ func AddActionsTables(x *xorm.Engine) error {
type ActionTaskStep struct {
ID int64
Name string
TaskID int64 `xorm:"index unique(task_number)"`
Number int64 `xorm:"index unique(task_number)"`
RepoID int64 `xorm:"index"`
Status int `xorm:"index"`
Name string `xorm:"VARCHAR(255)"`
TaskID int64 `xorm:"index unique(task_number)"`
Number int64 `xorm:"index unique(task_number)"`
RepoID int64 `xorm:"index"`
Status int `xorm:"index"`
LogIndex int64
LogLength int64
Started timeutil.TimeStamp