diff --git a/pkg/migration/20210209204715.go b/pkg/migration/20210209204715.go index 28403b438..7b16357c8 100644 --- a/pkg/migration/20210209204715.go +++ b/pkg/migration/20210209204715.go @@ -24,9 +24,9 @@ import ( type subscriptions20210209204715 struct { ID int64 `xorm:"autoincr not null unique pk" json:"id"` - EntityType int `xorm:"not null" json:"-"` - EntityID int64 `xorm:"bigint not null" json:"entity_id"` - UserID int64 `xorm:"bigint not null" json:"-"` + EntityType int `xorm:"index not null" json:"-"` + EntityID int64 `xorm:"bigint index not null" json:"entity_id"` + UserID int64 `xorm:"bigint index not null" json:"-"` Created time.Time `xorm:"created not null" json:"created"` } diff --git a/pkg/models/subscription.go b/pkg/models/subscription.go index 7f64444e2..b764123eb 100644 --- a/pkg/models/subscription.go +++ b/pkg/models/subscription.go @@ -38,14 +38,14 @@ type Subscription struct { // The numeric ID of the subscription ID int64 `xorm:"autoincr not null unique pk" json:"id"` - EntityType SubscriptionEntityType `xorm:"not null" json:"-"` + EntityType SubscriptionEntityType `xorm:"index not null" json:"-"` Entity string `xorm:"-" json:"-" param:"entity"` // The id of the entity to subscribe to. - EntityID int64 `xorm:"bigint not null" json:"entity_id"` + EntityID int64 `xorm:"bigint index not null" json:"entity_id"` // The user who made this subscription User *user.User `xorm:"-" json:"user"` - UserID int64 `xorm:"bigint not null" json:"-"` + UserID int64 `xorm:"bigint index not null" json:"-"` // A timestamp when this subscription was created. You cannot change this value. Created time.Time `xorm:"created not null" json:"created"`