Add indiecies

This commit is contained in:
kolaente 2021-02-09 22:54:23 +01:00
parent cdab0c9a60
commit 303307da4e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 6 additions and 6 deletions

View File

@ -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"`
}

View File

@ -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"`