From 97f2f9e8dbae9ad54992f9a7ba7b0826e8be7fd0 Mon Sep 17 00:00:00 2001 From: Honnix Date: Tue, 27 Oct 2020 21:41:36 +0100 Subject: [PATCH] Add index prefix to model declaration (#134) --- pkg/repositories/models/named_entity.go | 8 ++++---- pkg/repositories/models/task.go | 2 +- pkg/repositories/models/workflow.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/repositories/models/named_entity.go b/pkg/repositories/models/named_entity.go index 2951f06b77..c6af64aad8 100644 --- a/pkg/repositories/models/named_entity.go +++ b/pkg/repositories/models/named_entity.go @@ -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 diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index 06ff4a5e28..dc5237c3ac 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -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"` diff --git a/pkg/repositories/models/workflow.go b/pkg/repositories/models/workflow.go index 39e78d8b5e..e7f9d7b286 100644 --- a/pkg/repositories/models/workflow.go +++ b/pkg/repositories/models/workflow.go @@ -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"`