feat(webhooks): add index on project id

This commit is contained in:
kolaente 2023-09-14 12:13:06 +02:00
parent 8d7a492936
commit 57de44694c
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ type webhooks20230913202615 struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"webhook"`
TargetURL string `xorm:"not null" valid:"minstringlength(1)" minLength:"1" json:"target_url"`
Events []string `xorm:"JSON not null" valid:"minstringlength(1)" minLength:"1" json:"event"`
ProjectID int64 `xorm:"not null" json:"project_id" param:"project"`
ProjectID int64 `xorm:"bigint not null index" json:"project_id" param:"project"`
CreatedByID int64 `xorm:"bigint not null" json:"-"`
Created time.Time `xorm:"created not null" json:"created"`
Updated time.Time `xorm:"updated not null" json:"updated"`

View File

@ -29,7 +29,7 @@ type Webhook struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"webhook"`
TargetURL string `xorm:"not null" valid:"minstringlength(1)" minLength:"1" json:"target_url"`
Events []string `xorm:"JSON not null" valid:"minstringlength(1)" minLength:"1" json:"event"`
ProjectID int64 `xorm:"not null" json:"project_id" param:"project"`
ProjectID int64 `xorm:"bigint not null index" json:"project_id" param:"project"`
// The user who initially created the webhook target.
CreatedBy *user.User `xorm:"-" json:"created_by" valid:"-"`