Skip to content

Commit

Permalink
Add index prefix to model declaration (flyteorg#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix authored Oct 27, 2020
1 parent 52ddcea commit 97f2f9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/repositories/models/named_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

// NamedEntityMetadata primary key
type NamedEntityMetadataKey struct {
ResourceType core.ResourceType `gorm:"primary_key;named_entity_metadata_type_project_domain_name_idx"`
Project string `gorm:"primary_key;named_entity_metadata_type_project_domain_name_idx"`
Domain string `gorm:"primary_key;named_entity_metadata_type_project_domain_name_idx"`
Name string `gorm:"primary_key;named_entity_metadata_type_project_domain_name_idx"`
ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"`
Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"`
Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"`
Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"`
}

// Fields to be composed into any named entity
Expand Down
2 changes: 1 addition & 1 deletion pkg/repositories/models/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package models

// Task primary key
type TaskKey struct {
Project string `gorm:"primary_key;task_project_domain_name_idx,task_project_domain_idx"`
Project string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx"`
Domain string `gorm:"primary_key;index:task_project_domain_name_idx,task_project_domain_idx"`
Name string `gorm:"primary_key;index:task_project_domain_name_idx"`
Version string `gorm:"primary_key"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/repositories/models/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package models

// Workflow primary key
type WorkflowKey struct {
Project string `gorm:"primary_key:workflow_project_domain_name_idx,workflow_project_domain_idx"`
Project string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx"`
Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx,workflow_project_domain_idx"`
Name string `gorm:"primary_key;index:workflow_project_domain_name_idx"`
Version string `gorm:"primary_key"`
Expand Down

0 comments on commit 97f2f9e

Please sign in to comment.