initial completion
This commit is contained in:
@@ -25,5 +25,8 @@ func Run(engine *xorm.Engine) error {
|
||||
if err := Run004(engine); err != nil {
|
||||
return err
|
||||
}
|
||||
return Run005(engine)
|
||||
if err := Run005(engine); err != nil {
|
||||
return err
|
||||
}
|
||||
return Run006(engine)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/forgeo/forgebucket/internal/models"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func Run006(engine *xorm.Engine) error {
|
||||
return engine.Sync2(
|
||||
&models.RepoDefaultReviewer{},
|
||||
&models.PrReviewer{},
|
||||
&models.RepoDefaultDescription{},
|
||||
&models.RepoExcludedFiles{},
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// RepoDefaultReviewer: users auto-added as reviewers when a PR is opened.
|
||||
type RepoDefaultReviewer struct {
|
||||
ID int64 `xorm:"'id' pk autoincr"`
|
||||
RepoID int64 `xorm:"'repo_id' notnull index"`
|
||||
UserID int64 `xorm:"'user_id' notnull"`
|
||||
CreatedAt time.Time `xorm:"'created_at' created"`
|
||||
}
|
||||
|
||||
// PrReviewer: a user assigned to review a specific pull request.
|
||||
type PrReviewer struct {
|
||||
ID int64 `xorm:"'id' pk autoincr"`
|
||||
PRID int64 `xorm:"'pr_id' notnull index"`
|
||||
UserID int64 `xorm:"'user_id' notnull"`
|
||||
AddedAt time.Time `xorm:"'added_at' created"`
|
||||
}
|
||||
|
||||
// RepoDefaultDescription: template pre-filled into new PR bodies.
|
||||
type RepoDefaultDescription struct {
|
||||
ID int64 `xorm:"'id' pk autoincr"`
|
||||
RepoID int64 `xorm:"'repo_id' notnull unique"`
|
||||
Template string `xorm:"'template' text"`
|
||||
}
|
||||
|
||||
// RepoExcludedFiles: newline-separated glob patterns for files omitted from PR diffs.
|
||||
type RepoExcludedFiles struct {
|
||||
ID int64 `xorm:"'id' pk autoincr"`
|
||||
RepoID int64 `xorm:"'repo_id' notnull unique"`
|
||||
Patterns string `xorm:"'patterns' text"`
|
||||
}
|
||||
Reference in New Issue
Block a user