Merge pull request #1823 from vaijab/parent_number
Add a reference to a parent build on forks / deploys
This commit is contained in:
commit
a52028a4e1
5 changed files with 23 additions and 0 deletions
|
@ -5,6 +5,7 @@ type Build struct {
|
|||
ID int64 `json:"id" meddler:"build_id,pk"`
|
||||
RepoID int64 `json:"-" meddler:"build_repo_id"`
|
||||
Number int `json:"number" meddler:"build_number"`
|
||||
Parent int `json:"parent" meddler:"build_parent"`
|
||||
Event string `json:"event" meddler:"build_event"`
|
||||
Status string `json:"status" meddler:"build_status"`
|
||||
Enqueued int64 `json:"enqueued_at" meddler:"build_enqueued"`
|
||||
|
|
|
@ -228,6 +228,7 @@ func PostBuild(c *gin.Context) {
|
|||
if forkit, _ := strconv.ParseBool(fork); forkit {
|
||||
build.ID = 0
|
||||
build.Number = 0
|
||||
build.Parent = num
|
||||
for _, job := range jobs {
|
||||
job.ID = 0
|
||||
job.NodeID = 0
|
||||
|
|
7
store/datastore/ddl/mysql/8.sql
Normal file
7
store/datastore/ddl/mysql/8.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
-- +migrate Up
|
||||
|
||||
ALTER TABLE builds ADD COLUMN build_parent INTEGER DEFAULT 0;
|
||||
|
||||
-- +migrate Down
|
||||
|
||||
ALTER TABLE builds DROP COLUMN build_parent;
|
7
store/datastore/ddl/postgres/8.sql
Normal file
7
store/datastore/ddl/postgres/8.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
-- +migrate Up
|
||||
|
||||
ALTER TABLE builds ADD COLUMN build_parent INTEGER DEFAULT 0;
|
||||
|
||||
-- +migrate Down
|
||||
|
||||
ALTER TABLE builds DROP COLUMN build_parent;
|
7
store/datastore/ddl/sqlite3/8.sql
Normal file
7
store/datastore/ddl/sqlite3/8.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
-- +migrate Up
|
||||
|
||||
ALTER TABLE builds ADD COLUMN build_parent INTEGER DEFAULT 0;
|
||||
|
||||
-- +migrate Down
|
||||
|
||||
ALTER TABLE builds DROP COLUMN build_parent;
|
Loading…
Reference in a new issue