From 3b3095c5461c9acb997dff3f61cbd149102d14fa Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Sat, 3 May 2025 22:49:15 +0000 Subject: [PATCH] Scale sets are unique within a runner group You can have multiple scale sets with the same name, as long as they live in different runner groups. Signed-off-by: Gabriel Adrian Samfira --- database/sql/models.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/database/sql/models.go b/database/sql/models.go index c1b6462d..d6fbb6e9 100644 --- a/database/sql/models.go +++ b/database/sql/models.go @@ -98,9 +98,10 @@ type ScaleSet struct { // the scale set was ceated in GARM but has not yet been created in GitHub. // The scale set ID is also not globally unique. It is only unique within the context // of an entity. - ScaleSetID int `gorm:"index:idx_scale_set"` - Name string `gorm:"index:idx_name"` - DisableUpdate bool + ScaleSetID int `gorm:"index:idx_scale_set"` + Name string `gorm:"unique_index:idx_name"` + GitHubRunnerGroup string `gorm:"unique_index:idx_name"` + DisableUpdate bool // State stores the provisioning state of the scale set in GitHub State params.ScaleSetState @@ -123,8 +124,7 @@ type ScaleSet struct { // ExtraSpecs is an opaque json that gets sent to the provider // as part of the bootstrap params for instances. It can contain // any kind of data needed by providers. - ExtraSpecs datatypes.JSON - GitHubRunnerGroup string + ExtraSpecs datatypes.JSON RepoID *uuid.UUID `gorm:"index"` Repository Repository `gorm:"foreignKey:RepoID;"`