Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create composite indexes [ResourceType, ReferenceUUID, ReferenceType] #1836

Merged
merged 1 commit into from
Aug 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/src/apiserver/model/resource_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ type ResourceReference struct {
ResourceUUID string `gorm:"column:ResourceUUID; not null; primary_key"`

// The type of the resource object
ResourceType common.ResourceType `gorm:"column:ResourceType; not null; primary_key"`
ResourceType common.ResourceType `gorm:"column:ResourceType; not null; primary_key; index:referencefilter"`

// The ID of the resource that been referenced to.
ReferenceUUID string `gorm:"column:ReferenceUUID; not null; "`
ReferenceUUID string `gorm:"column:ReferenceUUID; not null; index:referencefilter"`

// The name of the resource that been referenced to.
ReferenceName string `gorm:"column:ReferenceName; not null; "`

// The type of the resource that been referenced to.
ReferenceType common.ResourceType `gorm:"column:ReferenceType; not null; primary_key"`
ReferenceType common.ResourceType `gorm:"column:ReferenceType; not null; primary_key; index:referencefilter"`

// The relationship between the resource object and the resource that been referenced to.
Relationship common.Relationship `gorm:"column:Relationship; not null; "`
Expand Down