package migrations import ( "fmt" "code.gitea.io/gitea/modules/timeutil" "xorm.io/xorm" ) func addCloudBrainTable(x *xorm.Engine) error { type Cloudbrain struct { ID int64 `xorm:"pk autoincr"` JobID string `xorm:"INDEX NOT NULL"` JobName string Status string `xorm:"INDEX"` UserID int64 `xorm:"INDEX"` RepoID int64 `xorm:"INDEX"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` } if err := x.Sync2(new(Cloudbrain)); err != nil { return fmt.Errorf("Sync2: %v", err) } return nil }