diff --git a/flyteartifacts/pkg/db/gorm_models.go b/flyteartifacts/pkg/db/gorm_models.go index 101435a843..c13068b839 100644 --- a/flyteartifacts/pkg/db/gorm_models.go +++ b/flyteartifacts/pkg/db/gorm_models.go @@ -44,9 +44,9 @@ type Artifact struct { type TriggerKey struct { gorm.Model - Project string `gorm:"index:idx_pdn;index:idx_proj;type:varchar(64)"` - Domain string `gorm:"index:idx_pdn;index:idx_dom;type:varchar(64)"` - Name string `gorm:"index:idx_pdn;index:idx_name;type:varchar(255)"` + Project string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_proj;type:varchar(64)"` + Domain string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_dom;type:varchar(64)"` + Name string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_name;type:varchar(255)"` RunsOn []ArtifactKey `gorm:"many2many:active_trigger_artifact_keys;"` } diff --git a/flyteartifacts/pkg/db/migrations.go b/flyteartifacts/pkg/db/migrations.go index e91552f3e6..b09755115e 100644 --- a/flyteartifacts/pkg/db/migrations.go +++ b/flyteartifacts/pkg/db/migrations.go @@ -60,9 +60,9 @@ var Migrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type TriggerKey struct { gorm.Model - Project string `gorm:"index:idx_t_pdn;index:idx_t_proj;type:varchar(64)"` - Domain string `gorm:"index:idx_t_pdn;index:idx_t_dom;type:varchar(64)"` - Name string `gorm:"index:idx_t_pdn;index:idx_t_name;type:varchar(255)"` + Project string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_proj;type:varchar(64)"` + Domain string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_dom;type:varchar(64)"` + Name string `gorm:"uniqueIndex:idx_t_pdn;index:idx_t_name;type:varchar(255)"` RunsOn []ArtifactKey `gorm:"many2many:active_trigger_artifact_keys;"` }