diff --git a/api/login_test.go b/api/login_test.go index 9f565777..222aa9fe 100644 --- a/api/login_test.go +++ b/api/login_test.go @@ -86,13 +86,21 @@ func TestAuthRegister2(t *testing.T) { t.Fail() } + store := createStore() + + err = store.CreatePlaceholderUser() + + if err != nil { + t.Fail() + } + req, _ := http.NewRequest("POST", "/api/auth/register", bytes.NewBuffer(body)) rr := httptest.NewRecorder() r := Route() r.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - context.Set(r, "store", createStore()) + context.Set(r, "store", store) next.ServeHTTP(w, r) }) }) diff --git a/db/Schedule.go b/db/Schedule.go index 0d1e9009..c030730c 100644 --- a/db/Schedule.go +++ b/db/Schedule.go @@ -1,8 +1,10 @@ package db type Schedule struct { - ID int `db:"id" json:"id"` - ProjectID int `db:"project_id" json:"project_id"` - TemplateID int `db:"template_id" json:"template_id"` - CronFormat string `db:"cron_format" json:"cron_format"` + ID int `db:"id" json:"id"` + ProjectID int `db:"project_id" json:"project_id"` + TemplateID int `db:"template_id" json:"template_id"` + CronFormat string `db:"cron_format" json:"cron_format"` + RepositoryID *int `db:"repository_id" json:"repository_id"` + LastCommitHash *string `db:"last_commit_hash" json:"last_commit_hash"` } diff --git a/db/Template.go b/db/Template.go index aa396c3d..698fb7e4 100644 --- a/db/Template.go +++ b/db/Template.go @@ -44,6 +44,8 @@ type Template struct { ViewID *int `db:"view_id" json:"view_id"` LastTask *TaskWithTpl `db:"-" json:"last_task"` + + Autorun bool `db:"autorun" json:"-"` } func (tpl *Template) Validate() error {